patch 8.2.4589: cannot index the g: dictionary
Problem: Cannot index the g: dictionary.
Solution: Recognize using "g:[key]". (closes #9969)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 4066f8d..463d840 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -3523,12 +3523,14 @@
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;