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 <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Girish Palya
2025-08-16 18:04:04 +02:00
committed by Christian Brabandt
parent b405c79004
commit a09b1604d4
20 changed files with 191 additions and 28 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'*

View File

@ -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