Optimizing overlap correction for common case
Most of the time there's nothing after the cursor.
This commit is contained in:
parent
a18807d31e
commit
96b28b93a1
@ -131,6 +131,8 @@ def AdjustCandidateInsertionText( candidates ):
|
||||
|
||||
new_candidates = []
|
||||
text_after_cursor = vimsupport.TextAfterCursor()
|
||||
if not text_after_cursor:
|
||||
return candidates
|
||||
for candidate in candidates:
|
||||
if type( candidate ) is dict:
|
||||
new_candidate = candidate.copy()
|
||||
|
@ -67,8 +67,8 @@ def AdjustCandidateInsertionText_NotSuffix_test():
|
||||
|
||||
def AdjustCandidateInsertionText_NothingAfterCursor_test():
|
||||
vimsupport.TextAfterCursor = MagicMock( return_value = '' )
|
||||
eq_( [ { 'abbr': 'foofoo', 'word': 'foofoo' },
|
||||
{ 'abbr': 'zobar', 'word': 'zobar' }, ],
|
||||
eq_( [ 'foofoo',
|
||||
'zobar' ],
|
||||
base.AdjustCandidateInsertionText( [ 'foofoo',
|
||||
'zobar' ] ) )
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user