patch 9.0.0150: error for using #{ in an expression is a bit confusing
Problem: Error for using #{ in an expression is a bit confusing.
Solution: Mention that this error is only given for an expression.
Avoid giving the error more than once. (closes #10855)
diff --git a/src/vim9script.c b/src/vim9script.c
index 14f36b4..e3cb992 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -183,9 +183,9 @@
int
vim9_bad_comment(char_u *p)
{
- if (p[0] == '#' && p[1] == '{' && p[2] != '{')
+ if (!did_emsg && p[0] == '#' && p[1] == '{' && p[2] != '{')
{
- emsg(_(e_cannot_use_hash_curly_to_start_comment));
+ emsg(_(e_cannot_use_hash_curly_to_start_comment_in_an_expression));
return TRUE;
}
return FALSE;