]> granicus.if.org Git - vim/commitdiff
patch 8.2.2372: confusing error message for wrong :let command v8.2.2372
authorBram Moolenaar <Bram@vim.org>
Sun, 17 Jan 2021 19:52:13 +0000 (20:52 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 17 Jan 2021 19:52:13 +0000 (20:52 +0100)
Problem:    Confusing error message for wrong :let command.
Solution:   Only check for type in Vim9 script.

src/evalvars.c
src/version.c

index d98d9e4708fada5576efb9418e73aedc83acf2aa..200fb8f12c1709ef9c32dad6891f2e71912c77e7 100644 (file)
@@ -1061,7 +1061,8 @@ skip_var_list(
     char_u *
 skip_var_one(char_u *arg, int include_type)
 {
-    char_u *end;
+    char_u     *end;
+    int                vim9 = in_vim9script();
 
     if (*arg == '@' && arg[1] != NUL)
        return arg + 2;
@@ -1070,10 +1071,10 @@ skip_var_one(char_u *arg, int include_type)
 
     // "a: type" is declaring variable "a" with a type, not "a:".
     // Same for "s: type".
-    if (end == arg + 2 && end[-1] == ':')
+    if (vim9 && end == arg + 2 && end[-1] == ':')
        --end;
 
-    if (include_type && in_vim9script())
+    if (include_type && vim9)
     {
        if (*end == ':')
            end = skip_type(skipwhite(end + 1), FALSE);
index 289854e89ebcd6ac676b045cd8e0fa6e0dd92b4c..3a88080e0d7af04c062ead2895cbcce93c4ab084 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2372,
 /**/
     2371,
 /**/