summaryrefslogtreecommitdiffstats
path: root/src/ex_eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-03-25 22:15:28 +0100
committerBram Moolenaar <Bram@vim.org>2021-03-25 22:15:28 +0100
commitfa984418e7becd8e7d6543cd3ea25f605e9ac97f (patch)
tree1e8b4185c415271d0d51f74cd56dab2ad05b7ff5 /src/ex_eval.c
parenta91a71322dc2e6a1640e73b6da1f1a2f94f39a54 (diff)
patch 8.2.2652: Vim9: can use command modifier without an effectv8.2.2652
Problem: Vim9: can use command modifier without an effect. Solution: Give an error for a misplaced command modifier. Fix error message number.
Diffstat (limited to 'src/ex_eval.c')
-rw-r--r--src/ex_eval.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ex_eval.c b/src/ex_eval.c
index f6f766a300..1af21c2a8e 100644
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -1011,6 +1011,8 @@ ex_endif(exarg_T *eap)
{
cstack_T *cstack = eap->cstack;
+ if (cmdmod_error())
+ return;
did_endif = TRUE;
if (cstack->cs_idx < 0
|| (cstack->cs_flags[cstack->cs_idx]
@@ -1314,6 +1316,9 @@ ex_endwhile(exarg_T *eap)
int csf;
int fl;
+ if (cmdmod_error())
+ return;
+
if (eap->cmdidx == CMD_endwhile)
{
err = e_while;
@@ -1539,6 +1544,9 @@ ex_try(exarg_T *eap)
int skip;
cstack_T *cstack = eap->cstack;
+ if (cmdmod_error())
+ return;
+
if (cstack->cs_idx == CSTACK_LEN - 1)
eap->errmsg = _("E601: :try nesting too deep");
else
@@ -1617,6 +1625,9 @@ ex_catch(exarg_T *eap)
cstack_T *cstack = eap->cstack;
char_u *pat;
+ if (cmdmod_error())
+ return;
+
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
{
eap->errmsg = _(e_catch);
@@ -1777,6 +1788,9 @@ ex_finally(exarg_T *eap)
int pending = CSTP_NONE;
cstack_T *cstack = eap->cstack;
+ if (cmdmod_error())
+ return;
+
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
eap->errmsg = _(e_finally);
else
@@ -1906,6 +1920,9 @@ ex_endtry(exarg_T *eap)
void *rettv = NULL;
cstack_T *cstack = eap->cstack;
+ if (cmdmod_error())
+ return;
+
if (cstack->cs_trylevel <= 0 || cstack->cs_idx < 0)
eap->errmsg = _(e_no_endtry);
else