]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1228: completion: current position column wrong after got a match v9.1.1228
authorglepnir <glephunter@gmail.com>
Fri, 21 Mar 2025 16:16:21 +0000 (17:16 +0100)
committerChristian Brabandt <cb@256bit.org>
Fri, 21 Mar 2025 16:16:21 +0000 (17:16 +0100)
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>
src/search.c
src/testdir/test_ins_complete.vim
src/version.c

index 2698358c0983af60abb87d0fd00796831c694c70..abd74416d626c67a165b47d761fee991ed88f62a 100644 (file)
@@ -5392,7 +5392,6 @@ search_for_fuzzy_match(
                                }
 
                                *len = next_word_end - *ptr;
-                               current_pos.col = *len;
                            }
                        }
                        *pos = current_pos;
index 88d1c166169d1b59212f3df838bbf4ebfab52464..7b180a64e43a9f718fb86bc7ed2f953df4887c34 100644 (file)
@@ -2963,6 +2963,10 @@ func Test_complete_fuzzy_collect()
   call feedkeys("Sh\<C-X>\<C-K>\<C-N>\<C-N>\<CR>\<Esc>0", 'tx!')
   call assert_equal('think', getline(line('.') - 1))
 
+  call setline(1, ['foo bar fuzzy', 'completefuzzycollect'])
+  call feedkeys("Gofuzzy\<C-X>\<C-N>\<C-N>\<C-N>\<C-Y>\<Esc>0", 'tx!')
+  call assert_equal('completefuzzycollect', getline('.'))
+
   bw!
   bw!
   set dict&
index 8739da0d32f31fb4a952e4852d6df34c0274befb..18bf939a06060dbe8c10eeb9009d6dcc4a70d40a 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1228,
 /**/
     1227,
 /**/