summaryrefslogtreecommitdiff
path: root/src/ex_eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-08-05 20:40:03 +0200
committerBram Moolenaar <Bram@vim.org>2021-08-05 20:40:03 +0200
commit63b9173693015b135aad8e3657bef5e7f776787e (patch)
tree562fd413b11ae6a4c45f39538b89ec881aebf2cb /src/ex_eval.c
parentaf647e76cacc60d3cfc5df3ff5b3d9d4b69b519d (diff)
downloadvim-git-63b9173693015b135aad8e3657bef5e7f776787e.tar.gz
patch 8.2.3297: cannot use all commands inside a {} blockv8.2.3297
Problem: Cannot use all commands inside a {} block after :command and :autocmd. Solution: Do consider \n to separate commands. (closes #8620)
Diffstat (limited to 'src/ex_eval.c')
-rw-r--r--src/ex_eval.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ex_eval.c b/src/ex_eval.c
index 827f9cdcd..77dceccf0 100644
--- a/src/ex_eval.c
+++ b/src/ex_eval.c
@@ -1461,6 +1461,18 @@ ex_endblock(exarg_T *eap)
leave_block(cstack);
}
+ int
+inside_block(exarg_T *eap)
+{
+ cstack_T *cstack = eap->cstack;
+ int i;
+
+ for (i = 0; i <= cstack->cs_idx; ++i)
+ if (cstack->cs_flags[cstack->cs_idx] & CSF_BLOCK)
+ return TRUE;
+ return FALSE;
+}
+
/*
* ":throw expr"
*/