aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-25 12:38:52 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-25 12:48:37 -0400
commita868cd920a69e55284c0b8137d349e91f0b8f742 (patch)
treea932e676326bd98c3c74f63694fb11c3417cbaa3 /src/nvim/eval.c
parent36f78412f9f286e5f850cb89630f8fe57fe5a54f (diff)
downloadrneovim-a868cd920a69e55284c0b8137d349e91f0b8f742.tar.gz
rneovim-a868cd920a69e55284c0b8137d349e91f0b8f742.tar.bz2
rneovim-a868cd920a69e55284c0b8137d349e91f0b8f742.zip
vim-patch:8.2.1901: variable completion does not work in command line window
Problem: Variable completion does not work in command line window. Solution: Use the "prevwin". (closes vim/vim#7198) https://github.com/vim/vim/commit/4ff2f2fb6bef01a06bd726bae8dfa8dd6355d594 N/A patches for version.c: vim-patch:8.2.1899: crash in out-of-memory situation Problem: Crash in out-of-memory situation. Solution: Bail out if shell_name is NULL. (Dominique Pellé, closes vim/vim#7196) https://github.com/vim/vim/commit/67def64a4e4590a5f3b55ebfc33c42a3dcd7b559
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c11
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;