mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 9.1.0447: completion may be wrong when deleting all chars
Problem: completion may be wrong when deleting all chars Solution: reset compl_shown_match closes: #14854 Signed-off-by: glepnir <glephunter@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
ef73374dc3
commit
53387c55a1
@@ -1255,6 +1255,12 @@ ins_compl_build_pum(void)
|
|||||||
if (match_at_original_text(compl_shown_match))
|
if (match_at_original_text(compl_shown_match))
|
||||||
shown_match_ok = TRUE;
|
shown_match_ok = TRUE;
|
||||||
|
|
||||||
|
if (compl_leader != NULL
|
||||||
|
&& STRCMP(compl_leader, compl_orig_text) == 0
|
||||||
|
&& shown_match_ok == FALSE)
|
||||||
|
compl_shown_match = compl_no_select ? compl_first_match
|
||||||
|
: compl_first_match->cp_next;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
compl = compl_first_match;
|
compl = compl_first_match;
|
||||||
do
|
do
|
||||||
|
@@ -630,14 +630,14 @@ func Test_pum_with_preview_win()
|
|||||||
CheckScreendump
|
CheckScreendump
|
||||||
|
|
||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
funct Omni_test(findstart, base)
|
func 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', 'D')
|
call writefile(lines, 'Xpreviewscript', 'D')
|
||||||
|
@@ -1175,6 +1175,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&
|
||||||
|
@@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
447,
|
||||||
/**/
|
/**/
|
||||||
446,
|
446,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user