From 0e1ab0adb82c352c4fc7aea40ffecf3ef69ba8a7 Mon Sep 17 00:00:00 2001 From: Maxim Kim Date: Wed, 26 Nov 2025 20:23:44 +0000 Subject: [PATCH] patch 9.1.1929: completion: spell completion wrong with fuzzy Problem: completion: spell completion wrong with fuzzy Solution: Disable fuzzy sort for spell completion (Maxim Kim) fixes #18800 closes: #18809 Signed-off-by: Maxim Kim Signed-off-by: Christian Brabandt --- src/insexpand.c | 2 +- src/testdir/test_ins_complete.vim | 17 +++++++++++++++++ src/version.c | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/insexpand.c b/src/insexpand.c index 8ec549ae02..22caba3df5 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -5710,7 +5710,7 @@ ins_compl_get_exp(pos_T *ini) } may_trigger_modechanged(); - if (match_count > 0) + if (match_count > 0 && !ctrl_x_mode_spell()) { if (is_nearest_active() && !ins_compl_has_preinsert()) sort_compl_match_list(cp_compare_nearest); diff --git a/src/testdir/test_ins_complete.vim b/src/testdir/test_ins_complete.vim index 77be5b42e7..fbc15e5c1c 100644 --- a/src/testdir/test_ins_complete.vim +++ b/src/testdir/test_ins_complete.vim @@ -1320,6 +1320,23 @@ func Test_complete_wholeline() bw! endfunc +" Test for using CTRL-X CTRL-S to complete spell suggestions +func Test_complete_spell() + new + setlocal spell + " without fuzzy + call setline(1, 'The rigth thing') + exe "normal! A\\" + call assert_equal('The right thing', getline(1)) + %d + " with fuzzy + setlocal completeopt+=fuzzy + call setline(1, 'The rigth thing') + exe "normal! A\\" + call assert_equal('The right thing', getline(1)) + bw! +endfunc + " Test insert completion with 'cindent' (adjust the indent) func Test_complete_with_cindent() new diff --git a/src/version.c b/src/version.c index 8210130ee7..99a865d2a3 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1929, /**/ 1928, /**/ -- 2.47.3