diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-14 16:33:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-14 16:33:37 +0800 |
commit | 72a327cad20fa2dbb214177cc48c533543d5b9e8 (patch) | |
tree | 5682b3c2396ccb6250e4305931e514d1102a8dfb /src/nvim/ex_eval.c | |
parent | 37bb40701d672d5213ec1be4e21d7808aee968e7 (diff) | |
parent | 9c66b48316d85d24ee92d917765700713862aa2d (diff) | |
download | rneovim-72a327cad20fa2dbb214177cc48c533543d5b9e8.tar.gz rneovim-72a327cad20fa2dbb214177cc48c533543d5b9e8.tar.bz2 rneovim-72a327cad20fa2dbb214177cc48c533543d5b9e8.zip |
Merge pull request #23081 from zeertzjq/vim-8.2.1062
vim-patch:8.2.{1062,1063,1064,1065,1068,1069,1070,1071,1073,1074,1075,1076,1079,1080,1098,1099,1100,1125,1161,1162,1163,1203,3216}
Diffstat (limited to 'src/nvim/ex_eval.c')
-rw-r--r-- | src/nvim/ex_eval.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/nvim/ex_eval.c b/src/nvim/ex_eval.c index 27f012a4ab..5404ae6731 100644 --- a/src/nvim/ex_eval.c +++ b/src/nvim/ex_eval.c @@ -792,13 +792,15 @@ void report_discard_pending(int pending, void *value) void ex_eval(exarg_T *eap) { typval_T tv; - evalarg_T evalarg = { - .eval_flags = eap->skip ? 0 : EVAL_EVALUATE, - .eval_cookie = eap->getline == getsourceline ? eap->cookie : NULL, - }; + evalarg_T evalarg; + + fill_evalarg_from_eap(&evalarg, eap, eap->skip); + if (eval0(eap->arg, &tv, eap, &evalarg) == OK) { tv_clear(&tv); } + + clear_evalarg(&evalarg, eap); } /// Handle ":if". @@ -955,13 +957,12 @@ void ex_while(exarg_T *eap) eap->cmdidx == CMD_while ? CSF_WHILE : CSF_FOR; int skip = CHECK_SKIP; - if (eap->cmdidx == CMD_while) { - // ":while bool-expr" + if (eap->cmdidx == CMD_while) { // ":while bool-expr" result = eval_to_bool(eap->arg, &error, eap, skip); - } else { + } else { // ":for var in list-expr" + evalarg_T evalarg; + fill_evalarg_from_eap(&evalarg, eap, skip); void *fi; - - // ":for var in list-expr" if ((cstack->cs_lflags & CSL_HAD_LOOP) != 0) { // Jumping here from a ":continue" or ":endfor": use the // previously evaluated list. @@ -969,7 +970,7 @@ void ex_while(exarg_T *eap) error = false; } else { // Evaluate the argument and get the info in a structure. - fi = eval_for_line(eap->arg, &error, eap, skip); + fi = eval_for_line(eap->arg, &error, eap, &evalarg); cstack->cs_forinfo[cstack->cs_idx] = fi; } @@ -984,6 +985,7 @@ void ex_while(exarg_T *eap) free_for_info(fi); cstack->cs_forinfo[cstack->cs_idx] = NULL; } + clear_evalarg(&evalarg, eap); } // If this cstack entry was just initialised and is active, set the |