comparison src/ex_docmd.c @ 23549:4156f972efb1 v8.2.2317

patch 8.2.2317: Vim9: command modifier before list unpack doesn't work Commit: https://github.com/vim/vim/commit/9e0f883f89c915e08ef5fd9e6bf382af57fa9eb2 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 9 12:09:22 2021 +0100 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 https://github.com/vim/vim/issues/7641)
author Bram Moolenaar <Bram@vim.org>
date Sat, 09 Jan 2021 12:15:05 +0100
parents 7f0fc2ab90e3
children 8b6d289d182e
comparison
equal deleted inserted replaced
23548:32b16cb86594 23549:4156f972efb1
2743 // verbose = 123 2743 // verbose = 123
2744 // verbose += 123 2744 // verbose += 123
2745 // silent! verbose = func() 2745 // silent! verbose = func()
2746 // verbose.member = 2 2746 // verbose.member = 2
2747 // verbose[expr] = 2 2747 // verbose[expr] = 2
2748 // But not:
2749 // verbose [a, b] = list
2748 if (in_vim9script()) 2750 if (in_vim9script())
2749 { 2751 {
2750 char_u *s; 2752 char_u *s, *n;
2751 2753
2752 for (s = p; ASCII_ISALPHA(*s); ++s) 2754 for (s = p; ASCII_ISALPHA(*s); ++s)
2753 ; 2755 ;
2754 s = skipwhite(s); 2756 n = skipwhite(s);
2755 if (vim_strchr((char_u *)".[=", *s) != NULL 2757 if (vim_strchr((char_u *)".=", *n) != NULL
2756 || (*s != NUL && s[1] == '=')) 2758 || *s == '['
2759 || (*n != NUL && n[1] == '='))
2757 break; 2760 break;
2758 } 2761 }
2759 2762
2760 switch (*p) 2763 switch (*p)
2761 { 2764 {