]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.1069: Vim9: fail to check for white space in list v8.2.1069
authorBram Moolenaar <Bram@vim.org>
Sat, 27 Jun 2020 14:36:05 +0000 (16:36 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 27 Jun 2020 14:36:05 +0000 (16:36 +0200)
Problem:    Vim9: fail to check for white space in list.
Solution:   Add check for white space.

src/list.c
src/version.c

index 611171d1dc62b70152bca7c4b4a91cb0012f885c..c2c485652f1d979e46c6fc509c2d1e71ec2dff70 100644 (file)
@@ -1168,6 +1168,7 @@ get_list_tv(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int do_error)
     list_T     *l = NULL;
     typval_T   tv;
     listitem_T *item;
+    int                vim9script = current_sctx.sc_version == SCRIPT_VERSION_VIM9;
     int                had_comma;
 
     if (evaluate)
@@ -1198,10 +1199,17 @@ get_list_tv(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int do_error)
                clear_tv(&tv);
        }
 
-       // the comma must comma after the value
+       // the comma must come after the value
        had_comma = **arg == ',';
        if (had_comma)
+       {
+           if (vim9script && (*arg)[1] != NUL && !VIM_ISWHITE((*arg)[1]))
+           {
+               semsg(_(e_white_after), ",");
+               goto failret;
+           }
            *arg = skipwhite(*arg + 1);
+       }
 
        // the "]" can be on the next line
        eval_next_non_blank(*arg, evalarg, &getnext);
index f73afd8a1a6daa39c41fe38de3a22c14d7e55937..8cef53ef76c96faabd070265d1bf2beaf65ca5c6 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1069,
 /**/
     1068,
 /**/