Skip to content

Commit 0e1ab0a

Browse files
habamaxchrisbra
authored andcommitted
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 <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 712b650 commit 0e1ab0a

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

src/insexpand.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5710,7 +5710,7 @@ ins_compl_get_exp(pos_T *ini)
57105710
}
57115711
may_trigger_modechanged();
57125712

5713-
if (match_count > 0)
5713+
if (match_count > 0 && !ctrl_x_mode_spell())
57145714
{
57155715
if (is_nearest_active() && !ins_compl_has_preinsert())
57165716
sort_compl_match_list(cp_compare_nearest);

src/testdir/test_ins_complete.vim

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,23 @@ func Test_complete_wholeline()
13201320
bw!
13211321
endfunc
13221322

1323+
" Test for using CTRL-X CTRL-S to complete spell suggestions
1324+
func Test_complete_spell()
1325+
new
1326+
setlocal spell
1327+
" without fuzzy
1328+
call setline(1, 'The rigth thing')
1329+
exe "normal! A\<C-X>\<C-S>"
1330+
call assert_equal('The right thing', getline(1))
1331+
%d
1332+
" with fuzzy
1333+
setlocal completeopt+=fuzzy
1334+
call setline(1, 'The rigth thing')
1335+
exe "normal! A\<C-X>\<C-S>"
1336+
call assert_equal('The right thing', getline(1))
1337+
bw!
1338+
endfunc
1339+
13231340
" Test insert completion with 'cindent' (adjust the indent)
13241341
func Test_complete_with_cindent()
13251342
new

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ static char *(features[]) =
729729

730730
static int included_patches[] =
731731
{ /* Add new patch number below this line */
732+
/**/
733+
1929,
732734
/**/
733735
1928,
734736
/**/

0 commit comments

Comments
 (0)