patch 9.2.0759: Some code for 'autocompletedelay' is no longer needed
Commit:
https://github.com/vim/vim/commit/0b86b97cc9de013483875d0fab14d9040bcbe279
Author: zeertzjq <
zeer...@outlook.com>
Date: Wed Jul 1 18:31:14 2026 +0000
patch 9.2.0759: Some code for 'autocompletedelay' is no longer needed
Problem: Some code for 'autocompletedelay' is no longer needed now that
'autocompletedelay' doesn't block redraw (after 9.2.0739).
Solution: Remove unnecessary code. Also remove a duplicate screendump
and an outdated comment in test (zeertzjq)
closes: #20686
Signed-off-by: zeertzjq <
zeer...@outlook.com>
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/src/insexpand.c b/src/insexpand.c
index 331a50011..e566ee504 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -2568,12 +2568,6 @@ 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);
@@ -6224,7 +6218,6 @@ ins_compl_next(
int compl_no_insert = (cur_cot_flags & COT_NOINSERT) != 0
|| (compl_autocomplete && !ins_compl_has_preinsert());
int compl_preinsert = ins_compl_has_preinsert();
- int has_autocomplete_delay = (compl_autocomplete && p_acl > 0);
// When user complete function return -1 for findstart which is next
// time of 'always', compl_shown_match become NULL.
@@ -6268,11 +6261,7 @@ ins_compl_next(
// Insert the text of the new completion, or the compl_leader.
if (!started && ins_compl_preinsert_longest())
- {
ins_compl_insert(TRUE, TRUE);
- if (has_autocomplete_delay)
- update_screen(0); // Show the inserted text right away
- }
else if (compl_no_insert && !started && !compl_preinsert)
{
ins_compl_insert_bytes(compl_orig_text.string + get_compl_len(), -1);
@@ -6298,7 +6287,7 @@ ins_compl_next(
// may undisplay the popup menu first
ins_compl_upd_pum();
- if (pum_enough_matches() && !has_autocomplete_delay)
+ if (pum_enough_matches())
// Will display the popup menu, don't redraw yet to avoid flicker.
pum_call_update_screen();
else
@@ -6306,19 +6295,16 @@ ins_compl_next(
// inserted.
update_screen(0);
- if (!has_autocomplete_delay)
- {
- // display the updated popup menu
- ins_compl_show_pum();
+ // display the updated popup menu
+ ins_compl_show_pum();
#ifdef FEAT_GUI
- if (gui.in_use)
- {
- // Show the cursor after the match, not after the redrawn text.
- setcursor();
- out_flush_cursor(FALSE, FALSE);
- }
-#endif
+ if (gui.in_use)
+ {
+ // Show the cursor after the match, not after the redrawn text.
+ setcursor();
+ out_flush_cursor(FALSE, FALSE);
}
+#endif
// Delete old text to be replaced, since we're still searching and
// don't want to match ourselves!
diff --git a/src/testdir/dumps/Test_autocompletedelay_6.dump b/src/testdir/dumps/Test_autocompletedelay_6.dump
deleted file mode 100644
index c792e09ea..000000000
--- a/src/testdir/dumps/Test_autocompletedelay_6.dump
+++ /dev/null
@@ -1,10 +0,0 @@
-|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/test_ins_complete.vim b/src/testdir/test_ins_complete.vim
index 3d4c3fb30..5dd18ecf2 100644
--- a/src/testdir/test_ins_complete.vim
+++ b/src/testdir/test_ins_complete.vim
@@ -5947,7 +5947,7 @@ func Test_autocompletedelay()
call term_sendkeys(buf, "\<BS>")
call VerifyScreenDump(buf, 'Test_autocompletedelay_5', {})
sleep 500m
- call VerifyScreenDump(buf, 'Test_autocompletedelay_6', {})
+ call VerifyScreenDump(buf, 'Test_autocompletedelay_5', {})
" During delay wait, user can open menu using CTRL_N completion
call term_sendkeys(buf, "\<Esc>:set completeopt=menuone\<CR>")
@@ -6349,8 +6349,6 @@ func Test_autocompletedelay_longest_preinsert()
" Preinsert
call term_sendkeys(buf, "\<Esc>:set completeopt& completeopt+=preinsert\<CR>")
-
- " Show preinserted text right away but display popup later
call term_sendkeys(buf, "\<Esc>Sau")
sleep 100m
call VerifyScreenDump(buf, 'Test_autocompletedelay_preinsert_1', {})
diff --git a/src/version.c b/src/version.c
index 25c38c40e..33942d5b9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -759,6 +759,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 759,
/**/
758,
/**/