vim-patch:9.1.2070: completion: autocomplete breaks with large dict (#37331)

Problem:  Autocomplete breaks ":help" when 'dict' points to a large file
          (lxhillwind)
Solution: Reset autocompletion timer expiry flag (Girish Palya)

fixes:  vim/vim#19130
closes: vim/vim#19137

a9711b5395

Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
zeertzjq
2026-01-10 07:07:24 +08:00
committed by GitHub
parent 46f83dc271
commit 930817f100
2 changed files with 26 additions and 0 deletions

View File

@@ -6194,6 +6194,11 @@ int ins_complete(int c, bool enable_pum)
int save_w_leftcol = curwin->w_leftcol;
int n = ins_compl_next(true, ins_compl_key2count(c), insert_match);
// Reset autocompletion timer expiry flag
if (compl_autocomplete) {
compl_time_slice_expired = false;
}
if (n > 1) { // all matches have been found
compl_matches = n;
}

View File

@@ -6288,4 +6288,25 @@ func Test_fuzzy_filenames_compl_autocompl()
call StopVimInTerminal(buf)
endfunc
" Issue 19130
func Test_helptags_autocomplete_timeout()
func! TestComplete(findstart, base)
if a:findstart
return col('.') - 1
else
sleep 310m " Exceed timeout
return ["foo"]
endif
endfunc
call Ntest_override("char_avail", 1)
new
set autocomplete completeopt=fuzzy complete=.,FTestComplete
call feedkeys("Goa\<Esc>0", 'tx!')
call feedkeys(":h\<CR>", 'tx') " used to throw E149 exception
call Ntest_override("char_avail", 0)
set autocomplete& completeopt& complete&
bw!
endfunc
" vim: shiftwidth=2 sts=2 expandtab nofoldenable