Feat: Add 'autocompletedelay' option to control popup menu delay#17960
Feat: Add 'autocompletedelay' option to control popup menu delay#17960girishji wants to merge 1 commit intovim:masterfrom
Conversation
Should this also be mentioned in the help? Although "typing speed" is not a delay, so maybe "typing interval"? |
|
In Windows GVim (where the cursor is a thin vertical line), using this option (set autocompletedelay=1000) blocks the cursor movement on the first character. For example, when typing Futhermore, it seems that inoremap <expr> <cr> pumvisible() ? "\<c-y>" : "\<cr>"typing enter after |
I added something to that effect. |
|
@char101 Gvim handles the cursor slightly differently than terminal Vim. I’ll investigate. The pumvisible() issue should now be resolved. |
|
@char101 Can you give it a try now? I did not test on Gvim, but found some issues with cursor update. If it does not fix, let me know. |
|
I tried it and unfortunately the cursor is still stuck. I noticed that there is a function called cursor_on();
setcursor();
out_flush();with gui_update_cursor(TRUE, FALSE);and it does move the cursor. Edit: after looking at #ifdef FEAT_GUI
if (gui.in_use)
{
gui_update_cursor(FALSE, FALSE);
gui_mch_flush();
}
#endif |
|
Can you try (no need to check for gui): |
I have tested it and it seems to work. |
|
So is the current autocompletion too distracting? If yes, than we should possibly set the default to |
|
In my eyes such an option would make sense, so please take it into consideration to merge this PR. @girishji unfortunately, when Just insert a couple of characters, then begin a new word starting with an already existing character within the current buffer and quickly type
My settings are: If you need some more information, don't hesitate to ask me. |
|
@berggeist , you can try the following change. It ought to fix it. I'll have time later today to look into this in depth: |
|
@girishji thank you for your quick help. This fixes the core dumps 👍 |
b647c4d to
2f2fba4
Compare
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.
I’d lean toward keeping the delay at 0. I don’t think it is distracting, and it’s entirely subjective--users often equate how fast the popup appears with how “good” the autocompletion system feels. From experience building an autocomplete plugin, even a 10 ms delay isn’t consciously perceptible, but users strongly notice overall responsiveness, and any extra delay risks making the experience feel sluggish. A “reasonable” delay of several hundred milliseconds would also be entirely subjective. The framing of “if it’s distracting then set it to 10, if not then why do we need it” is a bit of a false dilemma. |
|
okay thanks, that's fair |
|
With For example, with After Edit: the |
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: vim#17960 Signed-off-by: Girish Palya <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
Problem: Autocompletion adds delay
(gcanat, char101, after v9.1.1638)
Solution: Temporarily disable autocomplation (Girish Palya).
related: #17960
fixes: #18022
closes: #18048
Signed-off-by: Girish Palya <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
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: vim/vim#17960 vim/vim@a09b160 N/A patch: vim-patch:9.1.1641: a few compiler warnings are output Co-authored-by: Girish Palya <[email protected]>
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: vim/vim#17960 vim/vim@a09b160 N/A patch: vim-patch:9.1.1641: a few compiler warnings are output Co-authored-by: Girish Palya <[email protected]>
Problem: Autocompletion adds delay
(gcanat, char101, after v9.1.1638)
Solution: Temporarily disable autocomplation (Girish Palya).
related: vim/vim#17960
fixes: vim/vim#18022
closes: vim/vim#18048
vim/vim@196c376
Co-authored-by: Girish Palya <[email protected]>
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: vim/vim#17960 vim/vim@a09b160 N/A patch: vim-patch:9.1.1641: a few compiler warnings are output Co-authored-by: Girish Palya <[email protected]>
Problem: Autocompletion adds delay
(gcanat, char101, after v9.1.1638)
Solution: Temporarily disable autocomplation (Girish Palya).
related: vim/vim#17960
fixes: vim/vim#18022
closes: vim/vim#18048
vim/vim@196c376
Co-authored-by: Girish Palya <[email protected]>
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: vim/vim#17960 vim/vim@a09b160 N/A patch: vim-patch:9.1.1641: a few compiler warnings are output Co-authored-by: Girish Palya <[email protected]>
Problem: Autocompletion adds delay
(gcanat, char101, after v9.1.1638)
Solution: Temporarily disable autocomplation (Girish Palya).
related: vim/vim#17960
fixes: vim/vim#18022
closes: vim/vim#18048
vim/vim@196c376
Co-authored-by: Girish Palya <[email protected]>
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: vim#17960 Signed-off-by: Girish Palya <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
Problem: Autocompletion adds delay
(gcanat, char101, after v9.1.1638)
Solution: Temporarily disable autocomplation (Girish Palya).
related: vim#17960
fixes: vim#18022
closes: vim#18048
Signed-off-by: Girish Palya <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
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: vim/vim#17960 vim/vim@a09b160 N/A patch: vim-patch:9.1.1641: a few compiler warnings are output Co-authored-by: Girish Palya <[email protected]>
Problem: Autocompletion adds delay
(gcanat, char101, after v9.1.1638)
Solution: Temporarily disable autocomplation (Girish Palya).
related: vim/vim#17960
fixes: vim/vim#18022
closes: vim/vim#18048
vim/vim@196c376
Co-authored-by: Girish Palya <[email protected]>
This patch introduces a new 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. Set this to a value slightly higher than your typing speed.
The default value is
0, which preserves the current immediate-popup behavior.Similar to
'editor.quickSuggestionsDelay'in VSCode.