diff options
author | ii14 <ii14@users.noreply.github.com> | 2022-09-07 19:40:17 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-07 19:40:17 +0100 |
commit | 7c7e1e9b98d4e5dbe7358c795a635c6f1f36f418 (patch) | |
tree | 3a7dae3fb1a09b2cd07325dac4e0ae827154eda5 /src/dict.c | |
parent | fef38d86a1fc3790d2ca7fc4b3e45071c1d8c79c (diff) | |
download | vim-git-7c7e1e9b98d4e5dbe7358c795a635c6f1f36f418.tar.gz |
patch 9.0.0409: #{g:x} was seen as a curly-braces expressionv9.0.0409
Problem: #{g:x} was seen as a curly-braces expression.
Solution: Do never see #{} as a curly-braces expression. (closes #11075)
Diffstat (limited to 'src/dict.c')
-rw-r--r-- | src/dict.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dict.c b/src/dict.c index 874b8231d..fa54c60c4 100644 --- a/src/dict.c +++ b/src/dict.c @@ -911,13 +911,15 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal) int vim9script = in_vim9script(); int had_comma; - // First check if it's not a curly-braces thing: {expr}. + // First check if it's not a curly-braces expression: {expr}. // Must do this without evaluating, otherwise a function may be called // twice. Unfortunately this means we need to call eval1() twice for the // first item. - // But {} is an empty Dictionary. + // "{}" is an empty Dictionary. + // "#{abc}" is never a curly-braces expression. if (!vim9script && *curly_expr != '}' + && !literal && eval1(&curly_expr, &tv, NULL) == OK && *skipwhite(curly_expr) == '}') return NOTDONE; |