mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
vim-patch:9.1.0684: completion is inserted on Enter with "noselect" (#30111)
Problem: completion is inserted on Enter with "noselect"
(Carman Fu)
Solution: check noselect before update compl_shown_match
(glepnir)
fixes: vim/vim#15526
closes: vim/vim#15530
753794bae8
This commit is contained in:
parent
53af02adba
commit
a6c4487e8b
@ -1244,7 +1244,9 @@ static int ins_compl_build_pum(void)
|
||||
if (comp->cp_score > max_fuzzy_score) {
|
||||
did_find_shown_match = true;
|
||||
max_fuzzy_score = comp->cp_score;
|
||||
compl_shown_match = comp;
|
||||
if (!compl_no_select) {
|
||||
compl_shown_match = comp;
|
||||
}
|
||||
}
|
||||
|
||||
if (!shown_match_ok && comp == compl_shown_match && !compl_no_select) {
|
||||
|
@ -2664,6 +2664,13 @@ func Test_complete_fuzzy_match()
|
||||
call feedkeys("A\<C-X>\<C-N>\<Esc>0", 'tx!')
|
||||
call assert_equal('hello help hero h', getline('.'))
|
||||
|
||||
" issue #15526
|
||||
set completeopt=fuzzy,menuone,menu,noselect
|
||||
call setline(1, ['Text', 'ToText', ''])
|
||||
call cursor(2, 1)
|
||||
call feedkeys("STe\<C-X>\<C-N>x\<CR>\<Esc>0", 'tx!')
|
||||
call assert_equal('Tex', getline('.'))
|
||||
|
||||
" clean up
|
||||
set omnifunc=
|
||||
bw!
|
||||
|
Loading…
Reference in New Issue
Block a user