Mercurial > vim
comparison src/ex_docmd.c @ 28129:dd2ed5345f20 v8.2.4589
patch 8.2.4589: cannot index the g: dictionary
Commit: https://github.com/vim/vim/commit/2e17fef225a58f478dc24ab1aaa20390c9abce57
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Mar 18 19:44:48 2022 +0000
patch 8.2.4589: cannot index the g: dictionary
Problem: Cannot index the g: dictionary.
Solution: Recognize using "g:[key]". (closes https://github.com/vim/vim/issues/9969)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 18 Mar 2022 20:45:04 +0100 |
parents | 442ca2007bec |
children | e1d1fa6ba1ed |
comparison
equal
deleted
inserted
replaced
28128:afa443a6179a | 28129:dd2ed5345f20 |
---|---|
3521 } | 3521 } |
3522 eap->cmdidx = CMD_eval; | 3522 eap->cmdidx = CMD_eval; |
3523 return eap->cmd; | 3523 return eap->cmd; |
3524 } | 3524 } |
3525 | 3525 |
3526 if (p != eap->cmd && ( | 3526 if ((p != eap->cmd && ( |
3527 // "varname[]" is an expression. | 3527 // "varname[]" is an expression. |
3528 *p == '[' | 3528 *p == '[' |
3529 // "varname.key" is an expression. | 3529 // "varname.key" is an expression. |
3530 || (*p == '.' && (ASCII_ISALPHA(p[1]) | 3530 || (*p == '.' |
3531 || p[1] == '_')))) | 3531 && (ASCII_ISALPHA(p[1]) || p[1] == '_')))) |
3532 // g:[key] is an expression | |
3533 || STRNCMP(eap->cmd, "g:[", 3) == 0) | |
3532 { | 3534 { |
3533 char_u *after = eap->cmd; | 3535 char_u *after = eap->cmd; |
3534 | 3536 |
3535 // When followed by "=" or "+=" then it is an assignment. | 3537 // When followed by "=" or "+=" then it is an assignment. |
3536 // Skip over the whole thing, it can be: | 3538 // Skip over the whole thing, it can be: |