Mercurial > vim
changeset 23660:f8f460738aaa v8.2.2372
patch 8.2.2372: confusing error message for wrong :let command
Commit: https://github.com/vim/vim/commit/585587dadbc2558520c33969098db9ff49598785
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 17 20:52:13 2021 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 17 Jan 2021 21:00:04 +0100 |
parents | 9c9233720588 |
children | 8c0e9b13694b |
files | src/evalvars.c src/version.c |
diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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_ty // "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);