]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1040: test for <Cmd> mapping with CmdlineChanged fails v9.0.1040
authorBram Moolenaar <Bram@vim.org>
Fri, 9 Dec 2022 12:41:32 +0000 (12:41 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 9 Dec 2022 12:41:32 +0000 (12:41 +0000)
Problem:    Test for <Cmd> mapping with CmdlineChanged fails.
Solution:   Put back the check for the cmdline length not changing.

src/ex_getln.c
src/version.c

index 0eb7d86c108572011179ba7f0c1fd4432a16416c..5614ea6a9e57cd7fb6bd9c6f2831f855513d7b48 100644 (file)
@@ -1785,13 +1785,16 @@ getcmdline_int(
 
        if (c == K_COMMAND || c == K_SCRIPT_COMMAND)
        {
+           int     clen = ccline.cmdlen;
            int     cc_count = aucmd_cmdline_changed_count;
 
            if (do_cmdkey_command(c, DOCMD_NOWAIT) == OK)
            {
-               // Do not trigger CmdlineChanged below if the <Cmd> mapping
-               // already did that.
-               if (cc_count != aucmd_cmdline_changed_count)
+               // Do not trigger CmdlineChanged below if:
+               // - the length of the command line didn't change
+               // - the <Cmd> mapping already triggered the event
+               if (clen == ccline.cmdlen
+                                   || cc_count != aucmd_cmdline_changed_count)
                    trigger_cmdlinechanged = FALSE;
                goto cmdline_changed;
            }
index bfa0c5df2e7de0e63951d87412af4ba66c75afc6..5e0bf4fe3d41e62ef3278d64114f458e69d87f4d 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1040,
 /**/
     1039,
 /**/