summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-08-06 18:12:06 +0100
committerBram Moolenaar <Bram@vim.org>2022-08-06 18:12:06 +0100
commit3f74c0ab32de7ed17dd16d9b06f5455a0bb1c297 (patch)
tree9e625386219dc1f5503d7e9a6a7e3ae75a9d2e17 /src/ex_docmd.c
parentdb9b96d84491131460e5876fe21b9bbc58c73ed7 (diff)
patch 9.0.0156: giving E1170 only in an expression is confusingv9.0.0156
Problem: Giving E1170 only in an expression is confusing. Solution: Give E1170 for any "#{ comment". (closes #10855)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index fad0bdacaf..d8a724393b 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2842,8 +2842,14 @@ parse_command_modifiers(
if (eap->nextcmd != NULL)
++eap->nextcmd;
}
- if (vim9script && has_cmdmod(cmod, FALSE))
- *errormsg = _(e_command_modifier_without_command);
+ if (vim9script)
+ {
+ if (has_cmdmod(cmod, FALSE))
+ *errormsg = _(e_command_modifier_without_command);
+ if (eap->cmd[0] == '#' && eap->cmd[1] == '{'
+ && eap->cmd[2] != '{')
+ *errormsg = _(e_cannot_use_hash_curly_to_start_comment);
+ }
return FAIL;
}
if (*eap->cmd == NUL)