summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-18 19:44:48 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-18 19:44:48 +0000
commit2e17fef225a58f478dc24ab1aaa20390c9abce57 (patch)
tree6454370682bf9c4cb2b927cf254090b210d3b5b0 /src/ex_docmd.c
parentf35fd8e5d484be0e3fdd7c3c24f690083f91264d (diff)
downloadvim-git-2e17fef225a58f478dc24ab1aaa20390c9abce57.tar.gz
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/ex_docmd.c')
-rw-r--r--src/ex_docmd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 4066f8de9..463d84078 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -3523,12 +3523,14 @@ find_ex_command(
return eap->cmd;
}
- if (p != eap->cmd && (
+ if ((p != eap->cmd && (
// "varname[]" is an expression.
*p == '['
// "varname.key" is an expression.
- || (*p == '.' && (ASCII_ISALPHA(p[1])
- || p[1] == '_'))))
+ || (*p == '.'
+ && (ASCII_ISALPHA(p[1]) || p[1] == '_'))))
+ // g:[key] is an expression
+ || STRNCMP(eap->cmd, "g:[", 3) == 0)
{
char_u *after = eap->cmd;