]> granicus.if.org Git - vim/commitdiff
patch 8.2.1331: Vim9: :echo with two lists doesn't work v8.2.1331
authorBram Moolenaar <Bram@vim.org>
Fri, 31 Jul 2020 20:38:17 +0000 (22:38 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 31 Jul 2020 20:38:17 +0000 (22:38 +0200)
Problem:    Vim9: :echo with two lists doesn't work.
Solution:   Do not skip white space before []. (closes #6552)

src/testdir/test_vim9_expr.vim
src/version.c
src/vim9compile.c

index 550e41982636325dc6fde81c65c8287125c3553d..226db83f8086b55f39cb48d527a443f56e776575 100644 (file)
@@ -1176,6 +1176,10 @@ def Test_expr7_list()
   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 @@ def Test_expr7_list_vim9script()
                22,
                ]
       assert_equal([11, 22], l)
+
+      echo [1,
+           2] [3,
+                   4]
   END
   CheckScriptSuccess(lines)
 
index b52bd2f5082e6f68278e332aa098131a59a4f3ac..225674268c326baebe8887ed9d5ceeca14176771 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1331,
 /**/
     1330,
 /**/
index b9b2b6fa526cb342447db350bcf445c1f04fce1e..87a9fd1ce9dc91550f357df59beb4fd42a86ddd7 100644 (file)
@@ -3855,7 +3855,7 @@ compile_subscript(
                    return FAIL;
            }
        }
-       else if (*p == '[')
+       else if (**arg == '[')
        {
            garray_T    *stack = &cctx->ctx_type_stack;
            type_T      **typep;