forked from aniani/vim
patch 8.2.2071: Vim9: list assign doesn't except empty remainder list
Problem: Vim9: list assign doesn't except empty remainder list. Solution: Recognize list assignment with ";".
This commit is contained in:
@@ -3356,7 +3356,14 @@ find_ex_command(
|
|||||||
if (*eap->cmd == '[')
|
if (*eap->cmd == '[')
|
||||||
{
|
{
|
||||||
p = to_name_const_end(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;
|
eap->cmdidx = CMD_eval;
|
||||||
return eap->cmd;
|
return eap->cmd;
|
||||||
|
@@ -632,6 +632,7 @@ def Test_assignment_default()
|
|||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Test_assignment_var_list()
|
def Test_assignment_var_list()
|
||||||
|
var lines =<< trim END
|
||||||
var v1: string
|
var v1: string
|
||||||
var v2: string
|
var v2: string
|
||||||
var vrem: list<string>
|
var vrem: list<string>
|
||||||
@@ -656,6 +657,8 @@ def Test_assignment_var_list()
|
|||||||
assert_equal(3, &ts)
|
assert_equal(3, &ts)
|
||||||
assert_equal(4, &sw)
|
assert_equal(4, &sw)
|
||||||
set ts=8 sw=4
|
set ts=8 sw=4
|
||||||
|
END
|
||||||
|
CheckDefAndScriptSuccess(lines)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
def Test_assignment_vim9script()
|
def Test_assignment_vim9script()
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2071,
|
||||||
/**/
|
/**/
|
||||||
2070,
|
2070,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user