]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.2070: completion: autocomplete breaks with large dict v9.1.2070
authorGirish Palya <girishji@gmail.com>
Fri, 9 Jan 2026 16:59:30 +0000 (16:59 +0000)
committerChristian Brabandt <cb@256bit.org>
Fri, 9 Jan 2026 16:59:30 +0000 (16:59 +0000)
Problem:  Autocomplete breaks ":help" when 'dict' points to a large file
          (lxhillwind)
Solution: Reset autocompletion timer expiry flag (Girish Palya)

fixes:  #19130
closes: #19137

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/insexpand.c
src/testdir/test_ins_complete.vim
src/version.c

index 4e3973a9a7929b7bfd252c43c725b77cc80b294a..907d36aee37bd5fb7ec5f1e31cb4cc2989a27978 100644 (file)
@@ -7217,6 +7217,10 @@ ins_complete(int c, int enable_pum)
     save_w_leftcol = curwin->w_leftcol;
     n = ins_compl_next(TRUE, ins_compl_key2count(c), insert_match);
 
+    // Reset autocompletion timer expiry flag
+    if (compl_autocomplete)
+       compl_time_slice_expired = FALSE;
+
     // may undisplay the popup menu
     ins_compl_upd_pum();
 
index f839af77efd3d394c88d64e231e13d92108b925a..dcad25cfbd4229783254913b4af26899ea894af7 100644 (file)
@@ -6175,4 +6175,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 test_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 test_override("char_avail", 0)
+  set autocomplete& completeopt& complete&
+  bw!
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab nofoldenable
index 50544f86153e124f9abada23e23f21e95646ac38..6a94b422a60cf48b14b8987a2a80272e61b1b014 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2070,
 /**/
     2069,
 /**/