mirror of
https://github.com/neovim/neovim.git
synced 2026-03-31 12:52:13 +00:00
vim-patch:9.1.1929: completion: spell completion wrong with fuzzy (#36709)
Problem: completion: spell completion wrong with fuzzy
Solution: Disable fuzzy sort for spell completion
(Maxim Kim)
fixes vim/vim#18800
closes: vim/vim#18809
0e1ab0adb8
Co-authored-by: Maxim Kim <habamax@gmail.com>
This commit is contained in:
@@ -4936,7 +4936,7 @@ static int ins_compl_get_exp(pos_T *ini)
|
|||||||
}
|
}
|
||||||
may_trigger_modechanged();
|
may_trigger_modechanged();
|
||||||
|
|
||||||
if (match_count > 0) {
|
if (match_count > 0 && !ctrl_x_mode_spell()) {
|
||||||
if (is_nearest_active() && !ins_compl_has_preinsert()) {
|
if (is_nearest_active() && !ins_compl_has_preinsert()) {
|
||||||
sort_compl_match_list(cp_compare_nearest);
|
sort_compl_match_list(cp_compare_nearest);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1426,6 +1426,23 @@ func Test_complete_wholeline()
|
|||||||
bw!
|
bw!
|
||||||
endfunc
|
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\<C-X>\<C-S>"
|
||||||
|
call assert_equal('The right thing', getline(1))
|
||||||
|
%d
|
||||||
|
" with fuzzy
|
||||||
|
setlocal completeopt+=fuzzy
|
||||||
|
call setline(1, 'The rigth thing')
|
||||||
|
exe "normal! A\<C-X>\<C-S>"
|
||||||
|
call assert_equal('The right thing', getline(1))
|
||||||
|
bw!
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Test insert completion with 'cindent' (adjust the indent)
|
" Test insert completion with 'cindent' (adjust the indent)
|
||||||
func Test_complete_with_cindent()
|
func Test_complete_with_cindent()
|
||||||
new
|
new
|
||||||
|
|||||||
Reference in New Issue
Block a user