patch 9.2.0032: completion: hang with line completion and fuzzy
Commit:
https://github.com/vim/vim/commit/d8648f7279f5a61aaa9ceebc7330e09800947a35
Author: Hirohito Higashi <
h.eas...@gmail.com>
Date: Thu Feb 19 17:35:55 2026 +0000
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.eas...@gmail.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/src/fuzzy.c b/src/fuzzy.c
index 15e3c4cdb..9a94acea2 100644
--- a/src/fuzzy.c
+++ b/src/fuzzy.c
@@ -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
diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim
index 5d93a4248..7e92bac69 100644
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index b929dea0f..eb20c8273 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 32,
/**/
31,
/**/