patch 9.1.1638: completion: not possible to delay the autcompletion
Commit:
https://github.com/vim/vim/commit/a09b1604d4fe7516d87fbcbf2ffd2dc484799b23
Author: Girish Palya <[email protected]>
Date: Sat Aug 16 18:04:04 2025 +0200
patch 9.1.1638: completion: not possible to delay the autcompletion
Problem: completion: not possible to delay the autcompletion
Solution: add the 'autocompletedelay' option value (Girish Palya).
This patch introduces a new global option 'autocompletedelay'/'acl' that
specifies the delay, in milliseconds, before the autocomplete menu
appears after typing.
When set to a non-zero value, Vim waits for the specified time before
showing the completion popup, allowing users to reduce distraction from
rapid suggestion pop-ups or to fine-tune the responsiveness of
completion.
The default value is 0, which preserves the current immediate-popup
behavior.
closes: #17960
Signed-off-by: Girish Palya <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index a56ffc0d3..d017042c8 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1,4 +1,4 @@
-*insert.txt* For Vim version 9.1. Last change: 2025 Aug 06
+*insert.txt* For Vim version 9.1. Last change: 2025 Aug 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1138,8 +1138,8 @@ CTRL-X CTRL-Z Stop completion without
changing the text.
AUTOCOMPLETION *ins-autocompletion*
Vim can display a completion menu as you type, similar to using |i_CTRL-N|,
-but triggered automatically. See 'autocomplete'. The menu items are collected
-from the sources listed in the 'complete' option.
+but triggered automatically. See 'autocomplete' and 'autocompletedelay'.
+The menu items are collected from the sources listed in the 'complete' option.
Unlike manual |i_CTRL-N| completion, this mode uses a decaying timeout to keep
Vim responsive. Sources earlier in the 'complete' list are given more time
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index b22a1711d..74fddabbf 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 9.1. Last change: 2025 Aug 07
+*options.txt* For Vim version 9.1. Last change: 2025 Aug 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -918,6 +918,13 @@ A jump table for the options with a short description can
be found at |Q_op|.
When on, Vim shows a completion menu as you type, similar to using
|i_CTRL-N|, but triggered automatically. See |ins-autocompletion|.
+ *'autocompletedelay'* *'acl'*
+'autocompletedelay' 'acl' number (default 0)
+ global
+ Delay in milliseconds before the autocomplete menu appears after
+ typing. If you prefer it not to open too quickly, set this value
+ slightly above your typing speed. See |ins-autocompletion|.
+
*'autoindent'* *'ai'* *'noautoindent'* *'noai'*
'autoindent' 'ai' boolean (default off)
local to buffer
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index 0a5bcc970..4dbef3b76 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -1,4 +1,4 @@
-*quickref.txt* For Vim version 9.1. Last change: 2025 Aug 06
+*quickref.txt* For Vim version 9.1. Last change: 2025 Aug 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -608,6 +608,7 @@ Short explanation of each option: *option-list*
'arabicshape' 'arshape' do shaping for Arabic characters
'autochdir' 'acd' change directory to the file in the current window
'autocomplete' 'ac' enable automatic completion in insert mode
+'autocompletedelay' 'acl' delay in msec before menu appears after typing
'autoindent' 'ai' take indent for new line from previous line
'autoread' 'ar' autom. read file when changed outside of Vim
'autoshelldir' 'asd' change directory to the shell's current directory
diff --git a/runtime/doc/tags b/runtime/doc/tags
index d94bc5ba9..9a0f8f2cf 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -43,6 +43,7 @@ $quote eval.txt /*$quote*
'a motion.txt /*'a*
'ac' options.txt /*'ac'*
'acd' options.txt /*'acd'*
+'acl' options.txt /*'acl'*
'ai' options.txt /*'ai'*
'akm' options.txt /*'akm'*
'al' options.txt /*'al'*
@@ -64,6 +65,7 @@ $quote eval.txt /*$quote*
'asd' options.txt /*'asd'*
'autochdir' options.txt /*'autochdir'*
'autocomplete' options.txt /*'autocomplete'*
+'autocompletedelay' options.txt /*'autocompletedelay'*
'autoindent' options.txt /*'autoindent'*
'autoprint' vi_diff.txt /*'autoprint'*
'autoread' options.txt /*'autoread'*
diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index 281ae2d51..aa7a57ded 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -41815,6 +41815,7 @@ Ex-Commands: ~
Options: ~
'autocompletion' Enable auto completion |ins-autocompletion|
+'autocompletedelay' Delay in msec before menu appears after typing
'chistory' Size of the quickfix stack |quickfix-stack|.
'completefuzzycollect' Enable fuzzy collection of candidates for (some)
|ins-completion| modes
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 26c80e5ce..dc6aae08f 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
-" Last Change: 2025 Aug 07
+" Last Change: 2025 Aug 16
" Former Maintainer: Bram Moolenaar <[email protected]>
" If there already is an option window, jump to that one.
@@ -876,6 +876,8 @@ if has("insert_expand")
call <SID>OptionL("cpt")
call <SID>AddOption("autocomplete", gettext("automatic completion in insert
mode"))
call <SID>BinOptionG("ac", &ac)
+ call <SID>AddOption("autocompletedelay", gettext("delay in msec before menu
appears after typing"))
+ call append("$", " set acl=" . &acl)
call <SID>AddOption("completeopt", gettext("whether to use a popup menu for
Insert mode completion"))
call <SID>OptionL("cot")
call <SID>AddOption("completeitemalign", gettext("popup menu item align
order"))
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index a28aa77af..cf7f1a43a 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -2,7 +2,7 @@
" Language: Vim script
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
" Doug Kearns <[email protected]>
-" Last Change: 2025 Aug 01
+" Last Change: 2025 Aug 16
" Former Maintainer: Charles E. Campbell
" DO NOT CHANGE DIRECTLY.
@@ -63,11 +63,11 @@ syn keyword vimStdPlugin contained Arguments Asm Break
Cfilter Clear Continue Di
" vimOptions are caught only when contained in a vimSet {{{2
" GEN_SYN_VIM: vimOption normal, START_STR='syn keyword vimOption contained',
END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod'
-syn keyword vimOption contained al aleph ari allowrevins ambw ambiwidth arab
arabic arshape arabicshape acd autochdir ac autocomplete ai autoindent ar
autoread asd autoshelldir aw autowrite awa autowriteall bg background bs
backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip
bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr
balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt
breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap
cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink
cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard cpm
clipmethod ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments
cms commentstring skipwhite nextgroup=vimSetEqual,vimSetMod
-syn keyword vimOption contained cp compatible cpt complete cfu completefunc
cfc completefuzzycollect cia completeitemalign cot completeopt cpp
completepopup csl completeslash cocu concealcursor cole conceallevel cf confirm
ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg
csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder
csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt
cursorlineopt debug def define deco delcombine dict dictionary diff dia
diffanchors dex diffexpr dip diffopt dg digraph dir directory dy display ead
eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline
ea equalalways ep equalprg eb errorbells ef errorfile efm errorformat ek
esckeys ei eventignore skipwhite nextgroup=vimSetEqual,vimSetMod
-syn keyword vimOption contained eiw eventignorewin et expandtab ex exrc fenc
fileencoding fencs fileencodings ff fileformat ffs fileformats fic
fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl
foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl
foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines
fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo
formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr
guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli
guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile
hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp
hkmapp hls hlsearch skipwhite nextgroup=vimSetEqual,vimSetMod
-syn keyword vimOption contained icon iconstring ic ignorecase imaf
imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert ims
imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is
incsearch inde indentexpr indk indentkeys inf infercase im insertmode ise
isexpand isf isfname isi isident isk iskeyword isp isprint js joinspaces jop
jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap
langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw
lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw
lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc
makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd
maxfuncdepth mmd maxmapdepth mm maxmem skipwhite nextgroup=vimSetEqual,vimSetMod
-syn keyword vimOption contained mmp maxmempattern mmt maxmemtot msc
maxsearchcount mis menuitems mopt messagesopt msm mkspellmem ml modeline mle
modelineexpr mls modelines ma modifiable mod modified more mouse mousef
mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses
mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf
nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc
operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm
patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup
pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn
printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt
printoptions prompt ph pumheight skipwhite nextgroup=vimSetEqual,vimSetMod
+syn keyword vimOption contained al aleph ari allowrevins ambw ambiwidth arab
arabic arshape arabicshape acd autochdir ac autocomplete acl autocompletedelay
ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg
background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext
bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm
bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt
breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap
cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink
cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard cpm
clipmethod ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments
skipwhite nextgroup=vimSetEqual,vimSetMod
+syn keyword vimOption contained cms commentstring cp compatible cpt complete
cfu completefunc cfc completefuzzycollect cia completeitemalign cot completeopt
cpp completepopup csl completeslash cocu concealcursor cole conceallevel cf
confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg
cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto
cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul
cursorline culopt cursorlineopt debug def define deco delcombine dict
dictionary diff dia diffanchors dex diffexpr dip diffopt dg digraph dir
directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof
endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile
efm errorformat ek esckeys skipwhite nextgroup=vimSetEqual,vimSetMod
+syn keyword vimOption contained ei eventignore eiw eventignorewin et expandtab
ex exrc fenc fileencoding fencs fileencodings ff fileformat ffs fileformats fic
fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl
foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl
foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines
fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo
formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr
guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli
guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile
hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp
hkmapp skipwhite nextgroup=vimSetEqual,vimSetMod
+syn keyword vimOption contained hls hlsearch icon iconstring ic ignorecase
imaf imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert
ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is
incsearch inde indentexpr indk indentkeys inf infercase im insertmode ise
isexpand isf isfname isi isident isk iskeyword isp isprint js joinspaces jop
jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap
langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw
lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw
lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc
makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd
maxfuncdepth mmd maxmapdepth skipwhite nextgroup=vimSetEqual,vimSetMod
+syn keyword vimOption contained mm maxmem mmp maxmempattern mmt maxmemtot msc
maxsearchcount mis menuitems mopt messagesopt msm mkspellmem ml modeline mle
modelineexpr mls modelines ma modifiable mod modified more mouse mousef
mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses
mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf
nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc
operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm
patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup
pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn
printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt
printoptions prompt ph pumheight skipwhite nextgroup=vimSetEqual,vimSetMod
syn keyword vimOption contained pmw pummaxwidth pw pumwidth pythondll
pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc
qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber
remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc
rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb
scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect
sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf
shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp
shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw
shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc
sft showfulltag skipwhite nextgroup=vimSetEqual,vimSetMod
syn keyword vimOption contained sm showmatch smd showmode stal showtabline
stpl showtabpanel ss sidescroll siso sidescrolloff scl signcolumn scs smartcase
si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc
spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb
splitbelow spk splitkeep spr splitright sol startofline stl statusline su
suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol
syn syntax tcl tabclose tal tabline tpm tabpagemax tpl tabpanel tplo
tabpanelopt ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr
tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding
tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt
termwintype terse skipwhite nextgroup=vimSetEqual,vimSetMod
syn keyword vimOption contained ta textauto tx textmode tw textwidth tsr
thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title
titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm
ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype
udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut
updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile
vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb
visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig
wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak
winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw
winfixwidth wh winheight wmh winminheight skipwhite
nextgroup=vimSetEqual,vimSetMod
@@ -102,15 +102,15 @@ syn match vimOption contained "t_k;"
" vimOptions: These are the variable names {{{2
" GEN_SYN_VIM: vimOption normal variable, START_STR='syn keyword
vimOptionVarName contained', END_STR=''
-syn keyword vimOptionVarName contained al aleph ari allowrevins ambw ambiwidth
arab arabic arshape arabicshape acd autochdir ac autocomplete ai autoindent ar
autoread asd autoshelldir aw autowrite awa autowriteall bg background bs
backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip
bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr
balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt
breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap
cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink
cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard cpm
clipmethod ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments
cms commentstring
-syn keyword vimOptionVarName contained cp compatible cpt complete cfu
completefunc cfc completefuzzycollect cia completeitemalign cot completeopt cpp
completepopup csl completeslash cocu concealcursor cole conceallevel cf confirm
ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg
csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder
csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt
cursorlineopt debug def define deco delcombine dict dictionary diff dia
diffanchors dex diffexpr dip diffopt dg digraph dir directory dy display ead
eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline
ea equalalways ep equalprg eb errorbells ef errorfile efm errorformat ek
esckeys ei eventignore
-syn keyword vimOptionVarName contained eiw eventignorewin et expandtab ex exrc
fenc fileencoding fencs fileencodings ff fileformat ffs fileformats fic
fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl
foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl
foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines
fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo
formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr
guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli
guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile
hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp
hkmapp hls hlsearch
-syn keyword vimOptionVarName contained icon iconstring ic ignorecase imaf
imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert ims
imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is
incsearch inde indentexpr indk indentkeys inf infercase im insertmode ise
isexpand isf isfname isi isident isk iskeyword isp isprint js joinspaces jop
jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap
langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw
lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw
lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc
makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd
maxfuncdepth mmd maxmapdepth
-syn keyword vimOptionVarName contained mm maxmem mmp maxmempattern mmt
maxmemtot msc maxsearchcount mis menuitems mopt messagesopt msm mkspellmem ml
modeline mle modelineexpr mls modelines ma modifiable mod modified more mouse
mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses
mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf
nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc
operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm
patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup
pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn
printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt
printoptions prompt
-syn keyword vimOptionVarName contained ph pumheight pmw pummaxwidth pw
pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion
qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine
rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl
rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr
scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt
sect sections secure sel selection slm selectmode ssop sessionoptions sh shell
shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash
stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw
shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc
-syn keyword vimOptionVarName contained sft showfulltag sm showmatch smd
showmode stal showtabline stpl showtabpanel ss sidescroll siso sidescrolloff
scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts
softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo
spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol
startofline stl statusline su suffixes sua suffixesadd swf swapfile sws
swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm
tabpagemax tpl tabpanel tplo tabpanelopt ts tabstop tbs tagbsearch tc tagcase
tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term
tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl
termwinscroll tws termwinsize
-syn keyword vimOptionVarName contained twt termwintype terse ta textauto tx
textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout
tm timeoutlen title titlelen titleold titlestring tb toolbar tbis
toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym
ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur
undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs
verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif
viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc
wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim
wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf
wfh winfixheight wfw winfixwidth
-syn keyword vimOptionVarName contained wh winheight wmh winminheight wmw
winminwidth winptydll wiw winwidth wse wlseat wst wlsteal wtm wltimeoutlen wrap
wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay
xtermcodes
+syn keyword vimOptionVarName contained al aleph ari allowrevins ambw ambiwidth
arab arabic arshape arabicshape acd autochdir ac autocomplete acl
autocompletedelay ai autoindent ar autoread asd autoshelldir aw autowrite awa
autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir
bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm
balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri
breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt
buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin
cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb
clipboard cpm clipmethod ch cmdheight cwh cmdwinheight cc colorcolumn co columns
+syn keyword vimOptionVarName contained com comments cms commentstring cp
compatible cpt complete cfu completefunc cfc completefuzzycollect cia
completeitemalign cot completeopt cpp completepopup csl completeslash cocu
concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm
cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre
cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb
cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def
define deco delcombine dict dictionary diff dia diffanchors dex diffexpr dip
diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo
emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb
errorbells ef errorfile
+syn keyword vimOptionVarName contained efm errorformat ek esckeys ei
eventignore eiw eventignorewin et expandtab ex exrc fenc fileencoding fencs
fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs
fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen
foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr
foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt
foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs
fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs
guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions
guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang
hid hidden hl highlight
+syn keyword vimOptionVarName contained hi history hk hkmap hkp hkmapp hls
hlsearch icon iconstring ic ignorecase imaf imactivatefunc imak imactivatekey
imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst
imstyle inc include inex includeexpr is incsearch inde indentexpr indk
indentkeys inf infercase im insertmode ise isexpand isf isfname isi isident isk
iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel
kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm
langremap ls laststatus lz lazyredraw lhi lhistory lbr linebreak lines lsp
linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins
luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat
matchtime
+syn keyword vimOptionVarName contained mco maxcombine mfd maxfuncdepth mmd
maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot msc maxsearchcount mis
menuitems mopt messagesopt msm mkspellmem ml modeline mle modelineexpr mls
modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide
mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime
mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth
ofu omnifunc odev opendevice opfunc operatorfunc pp packpath para paragraphs
paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi
preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev
printdevice penc printencoding pexpr printexpr pfn printfont pheader
printheader pmbcs printmbcharset
+syn keyword vimOptionVarName contained pmbfn printmbfont popt printoptions
prompt ph pumheight pmw pummaxwidth pw pumwidth pythondll pythonhome
pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe
quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap
rop renderoptions report rs restorescreen ri revins rl rightleft rlc
rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb
scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect
sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf
shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp
shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw
shiftwidth shm shortmess sn shortname
+syn keyword vimOptionVarName contained sbr showbreak sc showcmd sloc
showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline stpl
showtabpanel ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si
smartindent sta smarttab sms smoothscroll sts softtabstop spell spc
spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb
splitbelow spk splitkeep spr splitright sol startofline stl statusline su
suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol
syn syntax tcl tabclose tal tabline tpm tabpagemax tpl tabpanel tplo
tabpanelopt ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr
tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding
tgc termguicolors twk termwinkey
+syn keyword vimOptionVarName contained twsl termwinscroll tws termwinsize twt
termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu
thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold
titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi
ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf
undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts
varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop
viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv
weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic
wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr
wincolor wi window
+syn keyword vimOptionVarName contained wfb winfixbuf wfh winfixheight wfw
winfixwidth wh winheight wmh winminheight wmw winminwidth winptydll wiw
winwidth wse wlseat wst wlsteal wtm wltimeoutlen wrap wm wrapmargin ws wrapscan
write wa writeany wb writebackup wd writedelay xtermcodes
" GEN_SYN_VIM: vimOption term output code variable, START_STR='syn keyword
vimOptionVarName contained', END_STR=''
syn keyword vimOptionVarName contained t_AB t_AF t_AU t_AL t_al t_bc t_BE t_BD
t_cd t_ce t_Ce t_CF t_cl t_cm t_Co t_CS t_Cs t_cs t_CV t_da t_db t_DL t_dl t_ds
t_Ds t_EC t_EI t_fs t_fd t_fe t_GP t_IE t_IS t_ke t_ks t_le t_mb t_md t_me t_mr
t_ms t_nd t_op t_RF t_RB t_RC t_RI t_Ri t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf
t_SH t_SI t_Si t_so t_SR t_sr t_ST t_Te t_te t_TE t_ti t_TI t_Ts t_ts t_u7 t_ue
t_us t_Us t_ut t_vb t_ve t_vi t_VS t_vs t_WP t_WS t_XM t_xn t_xs t_ZH t_ZR t_8f
t_8b t_8u t_xo
syn keyword vimOptionVarName contained t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8
t_F9 t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8
t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_KE t_KF t_KG t_kh t_KH t_kI
t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ku
diff --git a/src/insexpand.c b/src/insexpand.c
index 454466b30..b4364be63 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -2435,6 +2435,12 @@ ins_compl_new_leader(void)
ins_compl_insert_bytes(compl_leader.string + get_compl_len(), -1);
compl_used_match = FALSE;
+ if (p_acl > 0)
+ {
+ update_screen(UPD_VALID); // Show char (deletion) immediately
+ out_flush();
+ }
+
if (compl_started)
{
ins_compl_set_original_text(compl_leader.string, compl_leader.length);
@@ -5428,7 +5434,7 @@ ins_compl_get_exp(pos_T *ini)
{
static ins_compl_next_state_T st;
static int st_cleared = FALSE;
- int i;
+ int match_count;
int found_new_match;
int type = ctrl_x_mode;
int may_advance_cpt_idx = FALSE;
@@ -5579,10 +5585,10 @@ ins_compl_get_exp(pos_T *ini)
&& *st.e_cpt == NUL) // Got to end of 'complete'
found_new_match = FAIL;
- i = -1; // total of matches, unknown
+ match_count = -1; // total of matches, unknown
if (found_new_match == FAIL || (ctrl_x_mode_not_default()
&& !ctrl_x_mode_line_or_eval()))
- i = ins_compl_make_cyclic();
+ match_count = ins_compl_make_cyclic();
if (cfc_has_mode() && compl_get_longest && compl_num_bests > 0)
fuzzy_longest_match();
@@ -5602,7 +5608,7 @@ ins_compl_get_exp(pos_T *ini)
if (is_nearest_active())
sort_compl_match_list(cp_compare_nearest);
- return i;
+ return match_count;
}
/*
@@ -6130,7 +6136,7 @@ ins_compl_next(
check_elapsed_time(void)
{
#ifdef ELAPSED_FUNC
- if (cpt_sources_array == NULL)
+ if (cpt_sources_array == NULL || cpt_sources_index < 0)
return;
elapsed_T *start_tv
@@ -7070,6 +7076,10 @@ ins_complete(int c, int enable_pum)
int save_w_wrow;
int save_w_leftcol;
int insert_match;
+ int no_matches_found;
+#ifdef ELAPSED_FUNC
+ elapsed_T compl_start_tv; // Timestamp when match collection starts
+#endif
compl_direction = ins_compl_key2dir(c);
insert_match = ins_compl_use_match(c);
@@ -7082,6 +7092,10 @@ ins_complete(int c, int enable_pum)
else if (insert_match && stop_arrow() == FAIL)
return FAIL;
+#ifdef ELAPSED_FUNC
+ if (compl_autocomplete && p_acl > 0)
+ ELAPSED_INIT(compl_start_tv);
+#endif
compl_curr_win = curwin;
compl_curr_buf = curwin->w_buffer;
compl_shown_match = compl_curr_match;
@@ -7109,7 +7123,8 @@ ins_complete(int c, int enable_pum)
}
// we found no match if the list has only the "compl_orig_text"-entry
- if (is_first_match(compl_first_match->cp_next))
+ no_matches_found = is_first_match(compl_first_match->cp_next);
+ if (no_matches_found)
{
// remove N_ADDS flag, so next ^X<> won't try to go to ADDING mode,
// because we couldn't expand anything at first place, but if we used
@@ -7131,6 +7146,28 @@ ins_complete(int c, int enable_pum)
if (!shortmess(SHM_COMPLETIONMENU) && !compl_autocomplete)
ins_compl_show_statusmsg();
+ // Wait for the autocompletion delay to expire
+#ifdef ELAPSED_FUNC
+ if (compl_autocomplete && p_acl > 0 && !no_matches_found
+ && ELAPSED_FUNC(compl_start_tv) < p_acl)
+ {
+ cursor_on();
+ setcursor();
+ out_flush_cursor(FALSE, FALSE);
+ do
+ {
+ if (char_avail())
+ {
+ ins_compl_restart();
+ compl_interrupted = TRUE;
+ break;
+ }
+ else
+ ui_delay(2L, TRUE);
+ } while (ELAPSED_FUNC(compl_start_tv) < p_acl);
+ }
+#endif
+
// Show the popup menu, unless we got interrupted.
if (enable_pum && !compl_interrupted)
show_pum(save_w_wrow, save_w_leftcol);
diff --git a/src/option.h b/src/option.h
index 52fcfefcf..b11245e44 100644
--- a/src/option.h
+++ b/src/option.h
@@ -524,6 +524,7 @@ EXTERN unsigned cia_flags; // order flags of
'completeitemalign'
EXTERN char_u *p_cot; // 'completeopt'
EXTERN unsigned cot_flags; // flags from 'completeopt'
EXTERN int p_ac; // 'autocomplete'
+EXTERN long p_acl; // 'autocompletedelay'
// Keep in sync with p_cot_values in optionstr.c
#define COT_MENU 0x001
#define COT_MENUONE 0x002
diff --git a/src/optiondefs.h b/src/optiondefs.h
index 632ccf25f..d716d8995 100644
--- a/src/optiondefs.h
+++ b/src/optiondefs.h
@@ -392,6 +392,9 @@ static struct vimoption options[] =
{"autocomplete", "ac", P_BOOL|P_VI_DEF,
(char_u *)&p_ac, PV_NONE, NULL,
NULL, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
+ {"autocompletedelay", "acl", P_NUM|P_VI_DEF,
+ (char_u *)&p_acl, PV_NONE, NULL, NULL,
+ {(char_u *)0L, (char_u *)0L} SCTX_INIT},
#endif
{"autoindent", "ai", P_BOOL|P_VI_DEF,
(char_u *)&p_ai, PV_AI, NULL, NULL,
diff --git a/src/po/vim.pot b/src/po/vim.pot
index 43a8d64b2..b77bd8fc4 100644
--- a/src/po/vim.pot
+++ b/src/po/vim.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Vim
"
"Report-Msgid-Bugs-To: [email protected]
"
-"POT-Creation-Date: 2025-08-07 16:17+0200
"
+"POT-Creation-Date: 2025-08-16 17:57+0200
"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE
"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>
"
"Language-Team: LANGUAGE <[email protected]>
"
@@ -9926,6 +9926,9 @@ msgstr ""
msgid "automatic completion in insert mode"
msgstr ""
+msgid "delay in msec before menu appears after typing"
+msgstr ""
+
msgid "whether to use a popup menu for Insert mode completion"
msgstr ""
diff --git a/src/testdir/dumps/Test_autocompletedelay_1.dump
b/src/testdir/dumps/Test_autocompletedelay_1.dump
new file mode 100644
index 000000000..51128fc2f
--- /dev/null
+++ b/src/testdir/dumps/Test_autocompletedelay_1.dump
@@ -0,0 +1,10 @@
+|f+0&#ffffff0|o@1| @71
+|f|o@1|b|a|r| @68
+|f|o@1|b|a|r|b|a|z| @65
+|f> @73
+|f+0#0000001#ffd7ff255|o@1|b|a|r|b|a|z| @5| +0#4040ff13#ffffff0@59
+|f+0#0000001#ffd7ff255|o@1|b|a|r| @8| +0#4040ff13#ffffff0@59
+|f+0#0000001#ffd7ff255|o@1| @11| +0#4040ff13#ffffff0@59
+|~| @73
+|~| @73
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|1| @10|T|o|p|
diff --git a/src/testdir/dumps/Test_autocompletedelay_2.dump
b/src/testdir/dumps/Test_autocompletedelay_2.dump
new file mode 100644
index 000000000..65dc8f42e
--- /dev/null
+++ b/src/testdir/dumps/Test_autocompletedelay_2.dump
@@ -0,0 +1,10 @@
+|f+0&#ffffff0|o@1| @71
+|f|o@1|b|a|r| @68
+|f|o@1|b|a|r|b|a|z| @65
+|f> @73
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|1| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_autocompletedelay_3.dump
b/src/testdir/dumps/Test_autocompletedelay_3.dump
new file mode 100644
index 000000000..d3ed65d90
--- /dev/null
+++ b/src/testdir/dumps/Test_autocompletedelay_3.dump
@@ -0,0 +1,10 @@
+|f+0&#ffffff0|o@1| @71
+|f|o@1|b|a|r| @68
+|f|o@1|b|a|r|b|a|z| @65
+|f|o> @72
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|1| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_autocompletedelay_4.dump
b/src/testdir/dumps/Test_autocompletedelay_4.dump
new file mode 100644
index 000000000..53199f9d6
--- /dev/null
+++ b/src/testdir/dumps/Test_autocompletedelay_4.dump
@@ -0,0 +1,10 @@
+|f+0&#ffffff0|o@1| @71
+|f|o@1|b|a|r| @68
+|f|o@1|b|a|r|b|a|z| @65
+|f|o> @72
+|f+0#0000001#ffd7ff255|o@1|b|a|r|b|a|z| @5| +0#4040ff13#ffffff0@59
+|f+0#0000001#ffd7ff255|o@1|b|a|r| @8| +0#4040ff13#ffffff0@59
+|f+0#0000001#ffd7ff255|o@1| @11| +0#4040ff13#ffffff0@59
+|~| @73
+|~| @73
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|1| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_autocompletedelay_5.dump
b/src/testdir/dumps/Test_autocompletedelay_5.dump
new file mode 100644
index 000000000..0dd4850d0
--- /dev/null
+++ b/src/testdir/dumps/Test_autocompletedelay_5.dump
@@ -0,0 +1,10 @@
+|f+0&#ffffff0|o@1| @71
+|f|o@1|b|a|r| @68
+|f|o@1|b|a|r|b|a|z| @65
+|f> @73
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|2| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_autocompletedelay_6.dump
b/src/testdir/dumps/Test_autocompletedelay_6.dump
new file mode 100644
index 000000000..c792e09ea
--- /dev/null
+++ b/src/testdir/dumps/Test_autocompletedelay_6.dump
@@ -0,0 +1,10 @@
+|f+0&#ffffff0|o@1| @71
+|f|o@1|b|a|r| @68
+|f|o@1|b|a|r|b|a|z| @65
+|f> @73
+|f+0#0000001#ffd7ff255|o@1|b|a|r|b|a|z| @5| +0#4040ff13#ffffff0@59
+|f+0#0000001#ffd7ff255|o@1|b|a|r| @8| +0#4040ff13#ffffff0@59
+|f+0#0000001#ffd7ff255|o@1| @11| +0#4040ff13#ffffff0@59
+|~| @73
+|~| @73
+|-+2#0000000&@1| |I|N|S|E|R|T| |-@1| +0&&@44|4|,|2| @10|A|l@1|
diff --git a/src/testdir/dumps/Test_autocompletedelay_7.dump
b/src/testdir/dumps/Test_autocompletedelay_7.dump
new file mode 100644
index 000000000..954b785d8
--- /dev/null
+++ b/src/testdir/dumps/Test_autocompletedelay_7.dump
@@ -0,0 +1,10 @@
+|f+0&#ffffff0|o@1| @71
+|f|o@1|b|a|r| @68
+|f|o@1|b|a|r|b|a|z| @65
+|f>o@1| @71
+|f+0#0000001#e0e0e08|o@1| @11| +0#4040ff13#ffffff0@59
+|f+0#0000001#ffd7ff255|o@1|b|a|r| @8| +0#4040ff13#ffffff0@59
+|f+0#0000001#ffd7ff255|o@1|b|a|r|b|a|z| @5| +0#4040ff13#ffffff0@59
+|~| @73
+|~| @73
+|-+2#0000000&@1| |K|e|y|w|o|r|d| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)|
|m+0#00e0003&|a|t|c|h| |1| |o|f| |3| +0#0000000&@33
diff --git a/src/testdir/test_ins_complete.vim
b/src/testdir/test_ins_complete.vim
index 9acee8fe3..f3ea3a29f 100644
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -5460,4 +5460,38 @@ func Test_omni_start_invalid_col()
set omnifunc& complete&
endfunc
+func Test_autocompletedelay()
+ CheckScreendump
+
+ let lines =<< trim [SCRIPT]
+ call setline(1, ['foo', 'foobar', 'foobarbaz'])
+ set autocomplete
+ [SCRIPT]
+ call writefile(lines, 'XTest_autocomplete_delay', 'D')
+ let buf = RunVimInTerminal('-S XTest_autocomplete_delay', {'rows': 10})
+
+ call term_sendkeys(buf, "Gof")
+ call VerifyScreenDump(buf, 'Test_autocompletedelay_1', {})
+
+ call term_sendkeys(buf, "\<Esc>:set autocompletedelay=500\<CR>")
+ call term_sendkeys(buf, "Sf")
+ call VerifyScreenDump(buf, 'Test_autocompletedelay_2', {})
+ call term_sendkeys(buf, "o")
+ call VerifyScreenDump(buf, 'Test_autocompletedelay_3', {})
+ sleep 500m
+ call VerifyScreenDump(buf, 'Test_autocompletedelay_4', {})
+ call term_sendkeys(buf, "\<BS>")
+ call VerifyScreenDump(buf, 'Test_autocompletedelay_5', {})
+ sleep 500m
+ call VerifyScreenDump(buf, 'Test_autocompletedelay_6', {})
+
+ " During delay wait, user can open menu using CTRL_N completion
+ call term_sendkeys(buf, "\<Esc>:set completeopt=menuone,preinsert\<CR>")
+ call term_sendkeys(buf, "Sf\<C-N>")
+ call VerifyScreenDump(buf, 'Test_autocompletedelay_7', {})
+
+ call term_sendkeys(buf, "\<esc>")
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab nofoldenable
diff --git a/src/version.c b/src/version.c
index 7e4682cc8..5488cf8a1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -719,6 +719,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1638,
/**/
1637,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1unJYe-0018u4-VN%40256bit.org.