patch 8.2.2317: Vim9: command modifier before list unpack doesn't work
Problem: Vim9: command modifier before list unpack doesn't work.
Solution: Only recognize "[" directly after the name. (closes #7641)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 9659c20..a71adb8 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2745,15 +2745,18 @@
// 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;
}