diff options
author | Rom Grk <romgrk.cc@gmail.com> | 2020-11-03 03:11:08 -0500 |
---|---|---|
committer | Rom Grk <romgrk.cc@gmail.com> | 2020-11-03 03:11:08 -0500 |
commit | 13e0ca3e194a438383b8451e19090355aa6c29dc (patch) | |
tree | 0ac33ef5ac829b7c74dd15f34b17540c3186c356 /src/nvim/eval.c | |
parent | c7c865214655f7d88fde85ed4947f07319c14182 (diff) | |
parent | 5b5848f2fb1f4b7995bb8a59d94b6766d2182070 (diff) | |
download | rneovim-13e0ca3e194a438383b8451e19090355aa6c29dc.tar.gz rneovim-13e0ca3e194a438383b8451e19090355aa6c29dc.tar.bz2 rneovim-13e0ca3e194a438383b8451e19090355aa6c29dc.zip |
Merge branch 'master' into add-scroll-events
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; |