mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-16 15:04:05 +00:00
Use the given parser when fetching certain histories
This commit is contained in:
parent
9f7972a08b
commit
94dcd1cc07
2 changed files with 2 additions and 2 deletions
|
@ -484,7 +484,7 @@ static int builtin_set_list(const wchar_t *cmd, set_cmd_opts_t &opts, int argc,
|
||||||
wcstring val;
|
wcstring val;
|
||||||
if (opts.shorten_ok && key == L"history") {
|
if (opts.shorten_ok && key == L"history") {
|
||||||
history_t *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++) {
|
for (size_t i = 1; i < history->size() && val.size() < 64; i++) {
|
||||||
if (i > 1) val += L' ';
|
if (i > 1) val += L' ';
|
||||||
val += expand_escape_string(history->item_at_index(i).str());
|
val += expand_escape_string(history->item_at_index(i).str());
|
||||||
|
|
|
@ -1197,7 +1197,7 @@ bool completer_t::complete_variable(const wcstring &str, size_t start_offset) {
|
||||||
// #6288.
|
// #6288.
|
||||||
if (env_name == L"history") {
|
if (env_name == L"history") {
|
||||||
history_t *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++) {
|
for (size_t i = 1; i < history->size() && desc.size() < 64; i++) {
|
||||||
if (i > 1) desc += L' ';
|
if (i > 1) desc += L' ';
|
||||||
desc += expand_escape_string(history->item_at_index(i).str());
|
desc += expand_escape_string(history->item_at_index(i).str());
|
||||||
|
|
Loading…
Reference in a new issue