changeset 21036:f58ee30d863f v8.2.1069

patch 8.2.1069: Vim9: fail to check for white space in list Commit: https://github.com/vim/vim/commit/e6e031739c9d0c4140e371031b58a249db0eb572 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 27 16:36:05 2020 +0200 patch 8.2.1069: Vim9: fail to check for white space in list Problem: Vim9: fail to check for white space in list. Solution: Add check for white space.
author Bram Moolenaar <Bram@vim.org>
date Sat, 27 Jun 2020 16:45:05 +0200
parents 4fd89674f6f2
children 0484ff664beb
files src/list.c src/version.c
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/list.c
+++ b/src/list.c
@@ -1168,6 +1168,7 @@ get_list_tv(char_u **arg, typval_T *rett
     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 *rett
 		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);
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1069,
+/**/
     1068,
 /**/
     1067,