0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

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)
This commit is contained in:
Bram Moolenaar
2022-09-11 15:14:05 +01:00
parent cce82a55b8
commit 9510d22463
9 changed files with 51 additions and 20 deletions

View File

@@ -1031,12 +1031,16 @@ get_lval(
{
char_u *tp = skipwhite(p + 1);
if (is_scoped_variable(name))
{
semsg(_(e_cannot_use_type_with_this_variable_str), name);
return NULL;
}
if (tp == p + 1 && !quiet)
{
semsg(_(e_white_space_required_after_str_str), ":", p);
return NULL;
}
if (!SCRIPT_ID_VALID(current_sctx.sc_sid))
{
semsg(_(e_using_type_not_in_script_context_str), p);