patch 8.2.1331: Vim9: :echo with two lists doesn't work
Problem: Vim9: :echo with two lists doesn't work.
Solution: Do not skip white space before []. (closes #6552)
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index 550e419..226db83 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -1176,6 +1176,10 @@
assert_equal(g:list_mixed, [1, 'b', false,])
assert_equal('b', g:list_mixed[1])
+ echo [1,
+ 2] [3,
+ 4]
+
call CheckDefExecFailure(["let x = g:anint[3]"], 'E714:')
call CheckDefFailure(["let x = g:list_mixed[xxx]"], 'E1001:')
call CheckDefFailure(["let x = [1,2,3]"], 'E1069:')
@@ -1193,6 +1197,10 @@
22,
]
assert_equal([11, 22], l)
+
+ echo [1,
+ 2] [3,
+ 4]
END
CheckScriptSuccess(lines)
diff --git a/src/version.c b/src/version.c
index b52bd2f..2256742 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1331,
+/**/
1330,
/**/
1329,
diff --git a/src/vim9compile.c b/src/vim9compile.c
index b9b2b6f..87a9fd1 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3855,7 +3855,7 @@
return FAIL;
}
}
- else if (*p == '[')
+ else if (**arg == '[')
{
garray_T *stack = &cctx->ctx_type_stack;
type_T **typep;