diff options
-rw-r--r-- | src/ex_docmd.c | 9 | ||||
-rw-r--r-- | src/testdir/test_vim9_assign.vim | 51 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 37 insertions, 25 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index d530c0823..1d5d2dedc 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -3356,7 +3356,14 @@ find_ex_command( if (*eap->cmd == '[') { p = to_name_const_end(eap->cmd); - if (p == eap->cmd || *skipwhite(p) != '=') + if (p == eap->cmd && *p == '[') + { + int count = 0; + int semicolon = FALSE; + + p = skip_var_list(eap->cmd, TRUE, &count, &semicolon, TRUE); + } + if (p == NULL || p == eap->cmd || *skipwhite(p) != '=') { eap->cmdidx = CMD_eval; return eap->cmd; diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim index 2e08e8bb7..421229fd0 100644 --- a/src/testdir/test_vim9_assign.vim +++ b/src/testdir/test_vim9_assign.vim @@ -632,30 +632,33 @@ def Test_assignment_default() enddef def Test_assignment_var_list() - var v1: string - var v2: string - var vrem: list<string> - [v1] = ['aaa'] - assert_equal('aaa', v1) - - [v1, v2] = ['one', 'two'] - assert_equal('one', v1) - assert_equal('two', v2) - - [v1, v2; vrem] = ['one', 'two'] - assert_equal('one', v1) - assert_equal('two', v2) - assert_equal([], vrem) - - [v1, v2; vrem] = ['one', 'two', 'three'] - assert_equal('one', v1) - assert_equal('two', v2) - assert_equal(['three'], vrem) - - [&ts, &sw] = [3, 4] - assert_equal(3, &ts) - assert_equal(4, &sw) - set ts=8 sw=4 + var lines =<< trim END + var v1: string + var v2: string + var vrem: list<string> + [v1] = ['aaa'] + assert_equal('aaa', v1) + + [v1, v2] = ['one', 'two'] + assert_equal('one', v1) + assert_equal('two', v2) + + [v1, v2; vrem] = ['one', 'two'] + assert_equal('one', v1) + assert_equal('two', v2) + assert_equal([], vrem) + + [v1, v2; vrem] = ['one', 'two', 'three'] + assert_equal('one', v1) + assert_equal('two', v2) + assert_equal(['three'], vrem) + + [&ts, &sw] = [3, 4] + assert_equal(3, &ts) + assert_equal(4, &sw) + set ts=8 sw=4 + END + CheckDefAndScriptSuccess(lines) enddef def Test_assignment_vim9script() diff --git a/src/version.c b/src/version.c index 4eb7f4b59..845713367 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2071, +/**/ 2070, /**/ 2069, |