diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-01-09 12:09:22 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-01-09 12:09:22 +0100 |
commit | 9e0f883f89c915e08ef5fd9e6bf382af57fa9eb2 (patch) | |
tree | b83d962e5fb03abc623b4993afd3f4aae8a95fe4 /src/ex_docmd.c | |
parent | b657198cb30765468451d7f68fce49b5b4000c5d (diff) | |
download | vim-git-9e0f883f89c915e08ef5fd9e6bf382af57fa9eb2.tar.gz |
patch 8.2.2317: Vim9: command modifier before list unpack doesn't workv8.2.2317
Problem: Vim9: command modifier before list unpack doesn't work.
Solution: Only recognize "[" directly after the name. (closes #7641)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 9659c20b1..a71adb874 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2745,15 +2745,18 @@ parse_command_modifiers( // silent! verbose = func() // verbose.member = 2 // verbose[expr] = 2 + // But not: + // verbose [a, b] = list if (in_vim9script()) { - char_u *s; + char_u *s, *n; for (s = p; ASCII_ISALPHA(*s); ++s) ; - s = skipwhite(s); - if (vim_strchr((char_u *)".[=", *s) != NULL - || (*s != NUL && s[1] == '=')) + n = skipwhite(s); + if (vim_strchr((char_u *)".=", *n) != NULL + || *s == '[' + || (*n != NUL && n[1] == '=')) break; } |