]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0759: Some code for 'autocompletedelay' is no longer needed v9.2.0759
authorzeertzjq <zeertzjq@outlook.com>
Wed, 1 Jul 2026 18:31:14 +0000 (18:31 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 1 Jul 2026 18:31:14 +0000 (18:31 +0000)
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 <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/insexpand.c
src/testdir/dumps/Test_autocompletedelay_6.dump [deleted file]
src/testdir/test_ins_complete.vim
src/version.c

index 331a50011e8ebe23c0efda1dbc7bca6f134d1322..e566ee5044a536019373cdadca1306a11027421a 100644 (file)
@@ -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 (file)
index c792e09..0000000
+++ /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| 
index 3d4c3fb305c488e6b686317e9fd7e1d03d9d391e..5dd18ecf2f5b412effa161f15db805929eafc676 100644 (file)
@@ -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', {})
index 25c38c40e355b8b9c185c8320be8f3d669eb4268..33942d5b9236d49c901e38595de37564fab9b2f9 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    759,
 /**/
     758,
 /**/