1
0
forked from aniani/vim

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

@@ -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;