patch 8.2.3629: command completion in cmdline window uses global commands
Problem: Command completion in cmdline window uses global user commands,
not local commands for the window where it was opened from.
Solution: Use local commands. (closes #9168)
diff --git a/src/evalvars.c b/src/evalvars.c
index 6851eef..afbab79 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -2074,8 +2074,7 @@
ht =
#ifdef FEAT_CMDWIN
// In cmdwin, the alternative buffer should be used.
- (cmdwin_type != 0 && get_cmdline_type() == NUL) ?
- &prevwin->w_buffer->b_vars->dv_hashtab :
+ is_in_cmdwin() ? &prevwin->w_buffer->b_vars->dv_hashtab :
#endif
&curbuf->b_vars->dv_hashtab;
if (bdone < ht->ht_used)
@@ -2093,8 +2092,7 @@
ht =
#ifdef FEAT_CMDWIN
// In cmdwin, the alternative window should be used.
- (cmdwin_type != 0 && get_cmdline_type() == NUL) ?
- &prevwin->w_vars->dv_hashtab :
+ is_in_cmdwin() ? &prevwin->w_vars->dv_hashtab :
#endif
&curwin->w_vars->dv_hashtab;
if (wdone < ht->ht_used)