1
0
forked from aniani/vim

patch 8.2.2372: confusing error message for wrong :let command

Problem:    Confusing error message for wrong :let command.
Solution:   Only check for type in Vim9 script.
This commit is contained in:
Bram Moolenaar
2021-01-17 20:52:13 +01:00
parent 036d07144e
commit 585587dadb
2 changed files with 6 additions and 3 deletions

View File

@@ -1061,7 +1061,8 @@ skip_var_list(
char_u * char_u *
skip_var_one(char_u *arg, int include_type) skip_var_one(char_u *arg, int include_type)
{ {
char_u *end; char_u *end;
int vim9 = in_vim9script();
if (*arg == '@' && arg[1] != NUL) if (*arg == '@' && arg[1] != NUL)
return arg + 2; 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:". // "a: type" is declaring variable "a" with a type, not "a:".
// Same for "s: type". // Same for "s: type".
if (end == arg + 2 && end[-1] == ':') if (vim9 && end == arg + 2 && end[-1] == ':')
--end; --end;
if (include_type && in_vim9script()) if (include_type && vim9)
{ {
if (*end == ':') if (*end == ':')
end = skip_type(skipwhite(end + 1), FALSE); end = skip_type(skipwhite(end + 1), FALSE);

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
2372,
/**/ /**/
2371, 2371,
/**/ /**/