mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-18 03:41:16 -03:00
Fix updating command line on Page-Down
Page-Down seems to deactivate history search, so trying to undo
would leave the command line in an inconsistent state.
Fixes #7162 which was introduced in
12a9cb29 Fix assertion failure on page up / page down
This commit is contained in:
@@ -2059,10 +2059,9 @@ void reader_data_t::update_command_line_from_history_search() {
|
||||
}
|
||||
if (history_search.by_token()) {
|
||||
replace_current_token(std::move(new_text));
|
||||
} else if (history_search.by_line() || history_search.by_prefix()) {
|
||||
el->replace_substring(0, el->size(), std::move(new_text));
|
||||
} else {
|
||||
return;
|
||||
assert(history_search.by_line() || history_search.by_prefix());
|
||||
el->replace_substring(0, el->size(), std::move(new_text));
|
||||
}
|
||||
command_line_has_transient_edit = true;
|
||||
assert(el == &command_line);
|
||||
@@ -3124,7 +3123,9 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
|
||||
} else {
|
||||
history_search.go_to_end();
|
||||
}
|
||||
update_command_line_from_history_search();
|
||||
if (history_search.active()) {
|
||||
update_command_line_from_history_search();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user