diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-03-01 16:22:40 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-03-01 16:22:40 +0100 |
commit | 41fe061753923986e6676424132960d970bb2a76 (patch) | |
tree | 1c87494d9a04f7fe8dad5d6517594eb81e181750 /src/eval.c | |
parent | 087d2e15184bea3bf455dd266bd6ed66a45396e5 (diff) |
patch 8.2.0341: using ":for" in Vim9 script gives an errorv8.2.0341
Problem: Using ":for" in Vim9 script gives an error.
Solution: Pass the LET_NO_COMMAND flag. (closes #5715)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index c81ece1494..415ed5a9d3 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1491,6 +1491,8 @@ next_for_item(void *fi_void, char_u *arg) { forinfo_T *fi = (forinfo_T *)fi_void; int result; + int flag = current_sctx.sc_version == SCRIPT_VERSION_VIM9 ? + LET_NO_COMMAND : 0; listitem_T *item; if (fi->fi_blob != NULL) @@ -1504,7 +1506,7 @@ next_for_item(void *fi_void, char_u *arg) tv.vval.v_number = blob_get(fi->fi_blob, fi->fi_bi); ++fi->fi_bi; return ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon, - fi->fi_varcount, 0, NULL) == OK; + fi->fi_varcount, flag, NULL) == OK; } item = fi->fi_lw.lw_item; @@ -1514,7 +1516,7 @@ next_for_item(void *fi_void, char_u *arg) { fi->fi_lw.lw_item = item->li_next; result = (ex_let_vars(arg, &item->li_tv, TRUE, fi->fi_semicolon, - fi->fi_varcount, 0, NULL) == OK); + fi->fi_varcount, flag, NULL) == OK); } return result; } |