summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-01-09 12:09:22 +0100
committerBram Moolenaar <Bram@vim.org>2021-01-09 12:09:22 +0100
commit9e0f883f89c915e08ef5fd9e6bf382af57fa9eb2 (patch)
treeb83d962e5fb03abc623b4993afd3f4aae8a95fe4 /src/ex_docmd.c
parentb657198cb30765468451d7f68fce49b5b4000c5d (diff)
downloadvim-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.c11
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;
}