0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.4589: cannot index the g: dictionary

Problem:    Cannot index the g: dictionary.
Solution:   Recognize using "g:[key]". (closes #9969)
This commit is contained in:
Bram Moolenaar
2022-03-18 19:44:48 +00:00
parent f35fd8e5d4
commit 2e17fef225
5 changed files with 29 additions and 9 deletions

View File

@@ -929,7 +929,8 @@ get_lval(
if (vim9script)
{
// "a: type" is declaring variable "a" with a type, not "a:".
if (p == name + 2 && p[-1] == ':')
// However, "g:[key]" is indexing a dictionary.
if (p == name + 2 && p[-1] == ':' && *p != '[')
{
--p;
lp->ll_name_end = p;