Skip to content

Commit 5753084

Browse files
glepnirchrisbra
authored andcommitted
patch 9.1.1228: completion: current position column wrong after got a match
Problem: The current_pos.col was incorrectly updated to the length of the matching text. This will cause the next search to start from the wrong position. Solution: current_pos has already been updated in search_str_in_line and does not need to be changed (glepnir) closes: #16941 Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 83d7440 commit 5753084

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/search.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5392,7 +5392,6 @@ search_for_fuzzy_match(
53925392
}
53935393

53945394
*len = next_word_end - *ptr;
5395-
current_pos.col = *len;
53965395
}
53975396
}
53985397
*pos = current_pos;

src/testdir/test_ins_complete.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2963,6 +2963,10 @@ func Test_complete_fuzzy_collect()
29632963
call feedkeys("Sh\<C-X>\<C-K>\<C-N>\<C-N>\<CR>\<Esc>0", 'tx!')
29642964
call assert_equal('think', getline(line('.') - 1))
29652965

2966+
call setline(1, ['foo bar fuzzy', 'completefuzzycollect'])
2967+
call feedkeys("Gofuzzy\<C-X>\<C-N>\<C-N>\<C-N>\<C-Y>\<Esc>0", 'tx!')
2968+
call assert_equal('completefuzzycollect', getline('.'))
2969+
29662970
bw!
29672971
bw!
29682972
set dict&

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
1228,
707709
/**/
708710
1227,
709711
/**/

0 commit comments

Comments
 (0)