summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-18 19:53:28 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-18 19:53:28 +0200
commita26b9700d73ebccd6c5459d0d66032a4249f6b72 (patch)
tree2b7c7a0dfe64a8c707f36ce107dab9660adca200 /src/ex_docmd.c
parentb6fb0516ec862a18fdffe06c9400d507a7193835 (diff)
patch 8.2.0595: Vim9: not all commands using ends_excmd() testedv8.2.0595
Problem: Vim9: not all commands using ends_excmd() tested. Solution: Find # comment after regular commands. Add more tests. Report error for where it was caused.
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 25040df22d..5c18b0bccc 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1836,7 +1836,8 @@ do_one_cmd(
*/
if (*ea.cmd == NUL || *ea.cmd == '"'
#ifdef FEAT_EVAL
- || (*ea.cmd == '#' && !starts_with_colon && in_vim9script())
+ || (*ea.cmd == '#' && ea.cmd[1] != '{'
+ && !starts_with_colon && in_vim9script())
#endif
|| (ea.nextcmd = check_nextcmd(ea.cmd)) != NULL)
{
@@ -4436,6 +4437,10 @@ separate_nextcmd(exarg_T *eap)
|| p != eap->arg)
&& (eap->cmdidx != CMD_redir
|| p != eap->arg + 1 || p[-1] != '@'))
+#ifdef FEAT_EVAL
+ || (*p == '#' && in_vim9script()
+ && p[1] != '{' && p > eap->cmd && VIM_ISWHITE(p[-1]))
+#endif
|| *p == '|' || *p == '\n')
{
/*
@@ -4790,7 +4795,7 @@ ends_excmd2(char_u *cmd_start UNUSED, char_u *cmd)
int c = *cmd;
#ifdef FEAT_EVAL
- if (c == '#' && (cmd == cmd_start || VIM_ISWHITE(cmd[-1])))
+ if (c == '#' && cmd[1] != '{' && (cmd == cmd_start || VIM_ISWHITE(cmd[-1])))
return in_vim9script();
#endif
return (c == NUL || c == '|' || c == '"' || c == '\n');