patch 9.0.0156: giving E1170 only in an expression is confusing
Problem: Giving E1170 only in an expression is confusing.
Solution: Give E1170 for any "#{ comment". (closes #10855)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index fad0bda..d8a7243 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2842,8 +2842,14 @@
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)