comparison src/eval.c @ 19568:c0749ad6c699 v8.2.0341

patch 8.2.0341: using ":for" in Vim9 script gives an error Commit: https://github.com/vim/vim/commit/41fe061753923986e6676424132960d970bb2a76 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 1 16:22:40 2020 +0100 patch 8.2.0341: using ":for" in Vim9 script gives an error Problem: Using ":for" in Vim9 script gives an error. Solution: Pass the LET_NO_COMMAND flag. (closes https://github.com/vim/vim/issues/5715)
author Bram Moolenaar <Bram@vim.org>
date Sun, 01 Mar 2020 16:30:03 +0100
parents b38d73f36467
children 9daed26b788b
comparison
equal deleted inserted replaced
19567:b8c9eb5e8c2d 19568:c0749ad6c699
1489 int 1489 int
1490 next_for_item(void *fi_void, char_u *arg) 1490 next_for_item(void *fi_void, char_u *arg)
1491 { 1491 {
1492 forinfo_T *fi = (forinfo_T *)fi_void; 1492 forinfo_T *fi = (forinfo_T *)fi_void;
1493 int result; 1493 int result;
1494 int flag = current_sctx.sc_version == SCRIPT_VERSION_VIM9 ?
1495 LET_NO_COMMAND : 0;
1494 listitem_T *item; 1496 listitem_T *item;
1495 1497
1496 if (fi->fi_blob != NULL) 1498 if (fi->fi_blob != NULL)
1497 { 1499 {
1498 typval_T tv; 1500 typval_T tv;
1502 tv.v_type = VAR_NUMBER; 1504 tv.v_type = VAR_NUMBER;
1503 tv.v_lock = VAR_FIXED; 1505 tv.v_lock = VAR_FIXED;
1504 tv.vval.v_number = blob_get(fi->fi_blob, fi->fi_bi); 1506 tv.vval.v_number = blob_get(fi->fi_blob, fi->fi_bi);
1505 ++fi->fi_bi; 1507 ++fi->fi_bi;
1506 return ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon, 1508 return ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon,
1507 fi->fi_varcount, 0, NULL) == OK; 1509 fi->fi_varcount, flag, NULL) == OK;
1508 } 1510 }
1509 1511
1510 item = fi->fi_lw.lw_item; 1512 item = fi->fi_lw.lw_item;
1511 if (item == NULL) 1513 if (item == NULL)
1512 result = FALSE; 1514 result = FALSE;
1513 else 1515 else
1514 { 1516 {
1515 fi->fi_lw.lw_item = item->li_next; 1517 fi->fi_lw.lw_item = item->li_next;
1516 result = (ex_let_vars(arg, &item->li_tv, TRUE, fi->fi_semicolon, 1518 result = (ex_let_vars(arg, &item->li_tv, TRUE, fi->fi_semicolon,
1517 fi->fi_varcount, 0, NULL) == OK); 1519 fi->fi_varcount, flag, NULL) == OK);
1518 } 1520 }
1519 return result; 1521 return result;
1520 } 1522 }
1521 1523
1522 /* 1524 /*