diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-03-18 19:44:48 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-18 19:44:48 +0000 |
commit | 2e17fef225a58f478dc24ab1aaa20390c9abce57 (patch) | |
tree | 6454370682bf9c4cb2b927cf254090b210d3b5b0 /src/eval.c | |
parent | f35fd8e5d484be0e3fdd7c3c24f690083f91264d (diff) |
patch 8.2.4589: cannot index the g: dictionaryv8.2.4589
Problem: Cannot index the g: dictionary.
Solution: Recognize using "g:[key]". (closes #9969)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 3f6be18479..8d1e4fdf7e 100644 --- a/src/eval.c +++ b/src/eval.c @@ -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; |