diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-25 13:54:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-25 13:54:57 -0400 |
commit | c984a888b8249b9f0e92b2949f02b3816a5e6e3e (patch) | |
tree | f5176256d867f9a1bc68c7a59899626960b6d390 /src/nvim/eval.c | |
parent | c3ef19813293b0606eea68c924c5b611cdbf144b (diff) | |
parent | a868cd920a69e55284c0b8137d349e91f0b8f742 (diff) | |
download | rneovim-c984a888b8249b9f0e92b2949f02b3816a5e6e3e.tar.gz rneovim-c984a888b8249b9f0e92b2949f02b3816a5e6e3e.tar.bz2 rneovim-c984a888b8249b9f0e92b2949f02b3816a5e6e3e.zip |
Merge pull request #13151 from janlazo/vim-8.2.1892
vim-patch:8.1.1260,8.2.{87,393,506,618,1102,1892,1896,1899,1901}
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index a2490be355..cccf1e50ff 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -2994,7 +2994,6 @@ char_u *get_user_var_name(expand_T *xp, int idx) static size_t tdone; static size_t vidx; static hashitem_T *hi; - hashtab_T *ht; if (idx == 0) { gdone = bdone = wdone = vidx = 0; @@ -3015,7 +3014,10 @@ char_u *get_user_var_name(expand_T *xp, int idx) } // b: variables - ht = &curbuf->b_vars->dv_hashtab; + // In cmdwin, the alternative buffer should be used. + hashtab_T *ht = (cmdwin_type != 0 && get_cmdline_type() == NUL) + ? &prevwin->w_buffer->b_vars->dv_hashtab + : &curbuf->b_vars->dv_hashtab; if (bdone < ht->ht_used) { if (bdone++ == 0) hi = ht->ht_array; @@ -3027,7 +3029,10 @@ char_u *get_user_var_name(expand_T *xp, int idx) } // w: variables - ht = &curwin->w_vars->dv_hashtab; + // In cmdwin, the alternative window should be used. + ht = (cmdwin_type != 0 && get_cmdline_type() == NUL) + ? &prevwin->w_vars->dv_hashtab + : &curwin->w_vars->dv_hashtab; if (wdone < ht->ht_used) { if (wdone++ == 0) hi = ht->ht_array; |