]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.5093: error message for unknown command may have the command twice v8.2.5093
authorBram Moolenaar <Bram@vim.org>
Tue, 14 Jun 2022 15:06:07 +0000 (16:06 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 14 Jun 2022 15:06:07 +0000 (16:06 +0100)
Problem:    Error message for unknown command may mention the command twice.
            (Malcolm Rowe)
Solution:   Add the did_append_cmd flag. (closes #10570)

src/ex_docmd.c
src/version.c

index 23867d8ac9903660946da7745808770eb3e5f3eb..fed9330b52e92e1206eb519942ea1e4879cfa9d7 100644 (file)
@@ -1744,6 +1744,7 @@ do_one_cmd(
     int                did_set_expr_line = FALSE;
 #endif
     int                sourcing = flags & DOCMD_VERBOSE;
+    int                did_append_cmd = FALSE;
 
     CLEAR_FIELD(ea);
     ea.line1 = 1;
@@ -2019,6 +2020,7 @@ do_one_cmd(
                    append_command(after_modifier);
                else
                    append_command(*cmdlinep);
+               did_append_cmd = TRUE;
            }
            errormsg = (char *)IObuff;
            did_emsg_syntax = TRUE;
@@ -2609,7 +2611,7 @@ doend:
 
     if (errormsg != NULL && *errormsg != NUL && !did_emsg)
     {
-       if (sourcing || !KeyTyped)
+       if ((sourcing || !KeyTyped) && !did_append_cmd)
        {
            if (errormsg != (char *)IObuff)
            {
index f21efe157763fa79fa47d62796ac4ebf18f923a2..50c6ed3b0b6e9457d5c0935ef9b2c18d0f5d56a8 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    5093,
 /**/
     5092,
 /**/