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:
@@ -1062,6 +1062,7 @@ skip_var_list(
|
||||
skip_var_one(char_u *arg, int include_type)
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2372,
|
||||
/**/
|
||||
2371,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user