Mercurial > vim
diff src/ex_eval.c @ 25521:2063b858cad9 v8.2.3297
patch 8.2.3297: cannot use all commands inside a {} block
Commit: https://github.com/vim/vim/commit/63b9173693015b135aad8e3657bef5e7f776787e
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 5 20:40:03 2021 +0200
patch 8.2.3297: cannot use all commands inside a {} block
Problem: Cannot use all commands inside a {} block after :command and
:autocmd.
Solution: Do consider \n to separate commands. (closes #8620)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 05 Aug 2021 20:45:04 +0200 |
parents | f03271631eb5 |
children | e0d6268c153a |
line wrap: on
line diff
--- 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" */