mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:9.1.0447: completion may be wrong when deleting all chars (#29040)
Problem: completion may be wrong when deleting all chars.
Solution: reset compl_shown_match (glepnir).
closes: https://github.com/vim/vim/pull/14854
53387c55a1
This commit is contained in:
parent
48251134ee
commit
dbc2678f46
@ -1198,6 +1198,10 @@ static int ins_compl_build_pum(void)
|
|||||||
// match after it, don't highlight anything.
|
// match after it, don't highlight anything.
|
||||||
bool shown_match_ok = match_at_original_text(compl_shown_match);
|
bool shown_match_ok = match_at_original_text(compl_shown_match);
|
||||||
|
|
||||||
|
if (strequal(compl_leader, compl_orig_text) && !shown_match_ok) {
|
||||||
|
compl_shown_match = compl_no_select ? compl_first_match : compl_first_match->cp_next;
|
||||||
|
}
|
||||||
|
|
||||||
compl_T *shown_compl = NULL;
|
compl_T *shown_compl = NULL;
|
||||||
bool did_find_shown_match = false;
|
bool did_find_shown_match = false;
|
||||||
int cur = -1;
|
int cur = -1;
|
||||||
|
@ -700,14 +700,14 @@ func Test_pum_with_preview_win()
|
|||||||
CheckScreendump
|
CheckScreendump
|
||||||
|
|
||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
funct Omni_test(findstart, base)
|
funct Omni_test(findstart, base)
|
||||||
if a:findstart
|
if a:findstart
|
||||||
return col(".") - 1
|
return col(".") - 1
|
||||||
endif
|
endif
|
||||||
return [#{word: "one", info: "1info"}, #{word: "two", info: "2info"}, #{word: "three", info: "3info"}]
|
return [#{word: "one", info: "1info"}, #{word: "two", info: "2info"}, #{word: "three", info: "3info"}]
|
||||||
endfunc
|
endfunc
|
||||||
set omnifunc=Omni_test
|
set omnifunc=Omni_test
|
||||||
set completeopt+=longest
|
set completeopt+=longest
|
||||||
END
|
END
|
||||||
|
|
||||||
call writefile(lines, 'Xpreviewscript')
|
call writefile(lines, 'Xpreviewscript')
|
||||||
|
@ -1178,6 +1178,8 @@ func Test_CompleteChanged()
|
|||||||
set completeopt=menu,menuone
|
set completeopt=menu,menuone
|
||||||
call feedkeys("i\<C-X>\<C-O>\<BS>\<BS>\<BS>f", 'tx')
|
call feedkeys("i\<C-X>\<C-O>\<BS>\<BS>\<BS>f", 'tx')
|
||||||
call assert_equal('five', g:word)
|
call assert_equal('five', g:word)
|
||||||
|
call feedkeys("i\<C-X>\<C-O>\<BS>\<BS>\<BS>f\<BS>", 'tx')
|
||||||
|
call assert_equal('one', g:word)
|
||||||
|
|
||||||
autocmd! AAAAA_Group
|
autocmd! AAAAA_Group
|
||||||
set complete& completeopt&
|
set complete& completeopt&
|
||||||
|
Loading…
Reference in New Issue
Block a user