Use the given parser when fetching certain histories

This commit is contained in:
ridiculousfish 2019-12-29 14:21:29 -08:00
parent 9f7972a08b
commit 94dcd1cc07
2 changed files with 2 additions and 2 deletions

View file

@ -484,7 +484,7 @@ static int builtin_set_list(const wchar_t *cmd, set_cmd_opts_t &opts, int argc,
wcstring val;
if (opts.shorten_ok && key == L"history") {
history_t *history =
&history_t::history_with_name(history_session_id(env_stack_t::principal()));
&history_t::history_with_name(history_session_id(parser.vars()));
for (size_t i = 1; i < history->size() && val.size() < 64; i++) {
if (i > 1) val += L' ';
val += expand_escape_string(history->item_at_index(i).str());

View file

@ -1197,7 +1197,7 @@ bool completer_t::complete_variable(const wcstring &str, size_t start_offset) {
// #6288.
if (env_name == L"history") {
history_t *history =
&history_t::history_with_name(history_session_id(env_stack_t::principal()));
&history_t::history_with_name(history_session_id(parser->vars()));
for (size_t i = 1; i < history->size() && desc.size() < 64; i++) {
if (i > 1) desc += L' ';
desc += expand_escape_string(history->item_at_index(i).str());