0
0
mirror of https://github.com/vim/vim.git synced 2025-11-01 10:07:16 -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

@@ -1936,7 +1936,7 @@ def Test_var_not_cmd()
var lines =<< trim END
g:notexist:cmd
END
v9.CheckDefAndScriptFailure(lines, ['E488: Trailing characters: :cmd', 'E121: Undefined variable: g:notexist'], 1)
v9.CheckDefAndScriptFailure(lines, ['E1016: Cannot declare a global variable: g:notexist', "E1069: White space required after ':'"], 1)
lines =<< trim END
g-pat-cmd
@@ -1950,7 +1950,7 @@ def Test_var_not_cmd()
lines =<< trim END
s:notexist:repl
END
v9.CheckDefAndScriptFailure(lines, ['E488: Trailing characters: :repl', 'E1268:'], 1)
v9.CheckDefAndScriptFailure(lines, ['E1101: Cannot declare a script variable in a function: s:notexist', "E1069: White space required after ':'"], 1)
lines =<< trim END
notexist:repl