patch 9.0.0444: trying to declare g:variable gives confusing error
Problem: Trying to declare g:variable gives confusing error.
Solution: Give a better error message. (closes #11108)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 0024c99..0e5e1db 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -3761,11 +3761,11 @@
}
}
- // Recognize using a type for a w:, b:, t: or g: variable:
+ // Recognize trying to use a type for a w:, b:, t: or g: variable:
// "w:varname: number = 123".
if (eap->cmd[1] == ':' && *p == ':')
{
- eap->cmdidx = CMD_eval;
+ eap->cmdidx = CMD_var;
return eap->cmd;
}
}