From d8648f7279f5a61aaa9ceebc7330e09800947a35 Mon Sep 17 00:00:00 2001 From: Hirohito Higashi Date: Thu, 19 Feb 2026 17:35:55 +0000 Subject: [PATCH] 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 Signed-off-by: Christian Brabandt --- src/fuzzy.c | 3 ++- src/testdir/test_ins_complete.vim | 25 +++++++++++++++++++++++++ src/version.c | 2 ++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/fuzzy.c b/src/fuzzy.c index 15e3c4cdbe..9a94acea20 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 5d93a4248d..7e92bac69e 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, [ + \ '', + \ '', + \ ' ', + \ ' ', + \ ' ', + \ '
', + \ '
', + \ ' ', + \ '', + \ ]) + call cursor(6, 1) + call feedkeys("faC\\\0", 'tx!') + call assert_equal('