diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-01-17 20:52:13 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-01-17 20:52:13 +0100 |
commit | 585587dadbc2558520c33969098db9ff49598785 (patch) | |
tree | efb23aafa749cb295af79008c8563a713b238642 /src/evalvars.c | |
parent | 036d07144efe213199b1ed8de998e6f12a056499 (diff) | |
download | vim-git-585587dadbc2558520c33969098db9ff49598785.tar.gz |
patch 8.2.2372: confusing error message for wrong :let commandv8.2.2372
Problem: Confusing error message for wrong :let command.
Solution: Only check for type in Vim9 script.
Diffstat (limited to 'src/evalvars.c')
-rw-r--r-- | src/evalvars.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/evalvars.c b/src/evalvars.c index d98d9e470..200fb8f12 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -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); |