patch 9.2.0032: completion: hang with line completion and fuzzy

Problem:  completion: hang with line completion and fuzzy (Jesse Pavel)
Solution: Only check the line number when wrapping around the file
          (Hirohito Higashi).

fixes:  #19434
closes: #19443

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Hirohito Higashi
2026-02-19 17:35:55 +00:00
committed by Christian Brabandt
parent ed202035b1
commit d8648f7279
3 changed files with 29 additions and 1 deletions
+2 -1
View File
@@ -816,7 +816,8 @@ search_for_fuzzy_match(
{
// Check if looped around and back to start position
if (looped_around && EQUAL_POS(current_pos, circly_end))
if (looped_around && (whole_line ? current_pos.lnum == circly_end.lnum
: EQUAL_POS(current_pos, circly_end)))
break;
// Ensure current_pos is valid
+25
View File
@@ -3835,6 +3835,31 @@ func Test_complete_fuzzy_collect()
set completeopt& cpt& ignorecase& infercase&
endfunc
" Issue #19434
" Fuzzy whole-line completion should not loop infinitely when the cursor is in
" the middle of the line (non-zero column).
func Test_complete_fuzzy_wholeline_no_hang()
new
set completeopt=preview,fuzzy,noinsert,menuone
call setline(1, [
\ '<!DOCTYPE html>',
\ '<html lang="en-US">',
\ ' <head>',
\ ' </head>',
\ ' <body>',
\ ' <div class="page-landscape">',
\ ' </div>',
\ ' </body>',
\ '</html>',
\ ])
call cursor(6, 1)
call feedkeys("faC\<C-X>\<C-L>\<Esc>0", 'tx!')
call assert_equal(' <div cl', getline(6))
bw!
set completeopt&
endfunc
" Issue #18752
func Test_complete_fuzzy_collect_multiwin()
new
+2
View File
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
32,
/**/
31,
/**/