vim-patch:9.1.1799: completion: crash with autcompletion (#35963)

Problem:  completion: crash with autcompletion
          (Maxim Kim)
Solution: Rework remove_old_matches (Girish Palya)

fixes: vim/vim#18378
fixes: vim/vim#18390
fixes: vim/vim#18391
closes: vim/vim#18427

3aa2edb557

Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
zeertzjq
2025-09-30 10:42:13 +08:00
committed by GitHub
parent 77545c0f3c
commit 35fc4fda99
2 changed files with 70 additions and 46 deletions

View File

@@ -6080,4 +6080,33 @@ func Test_fuzzy_select_item_when_acl()
call StopVimInTerminal(buf)
endfunc
" Issue #18378: crash when fuzzy reorders items during refresh:always
func Test_refresh_always_with_fuzzy()
func ComplFunc1(findstart, base)
if a:findstart
return 1
else
return ['foo', 'foobar']
endif
endfunc
func ComplFunc2(findstart, base)
if a:findstart
return 1
else
return #{words: ['foo'], refresh: 'always'}
endif
endfunc
set complete=.,FComplFunc1,FComplFunc2
set autocomplete
call Ntest_override("char_avail", 1)
new
call setline(1, ['fox'])
exe "normal! Gofo"
bw!
delfunc ComplFunc1
delfunc ComplFunc2
set complete& autocomplete&
call Ntest_override("char_avail", 0)
endfunc
" vim: shiftwidth=2 sts=2 expandtab nofoldenable