diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-06-27 16:36:05 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-06-27 16:36:05 +0200 |
commit | e6e031739c9d0c4140e371031b58a249db0eb572 (patch) | |
tree | 1f4bf1605660f243008fe62c5ce94b965203d475 /src/list.c | |
parent | 8ea9390b78da9e34a20e7418712921397c0c1989 (diff) |
patch 8.2.1069: Vim9: fail to check for white space in listv8.2.1069
Problem: Vim9: fail to check for white space in list.
Solution: Add check for white space.
Diffstat (limited to 'src/list.c')
-rw-r--r-- | src/list.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/list.c b/src/list.c index 611171d1dc..c2c485652f 100644 --- a/src/list.c +++ b/src/list.c @@ -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); |