mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-30 15:21:16 -03:00
reader: make Escape during history search restore commandline again
Commit 3b30d92b6 (Commit transient edit when closing pager, 2022-08-31)
inadvertently introduced two regressions to history search:
1. It made Escape keeps the selected history entry,
instead of restoring the commandline before history search.
2. It made history search commands add undo entries.
Fix both of this issues.
This commit is contained in:
@@ -4482,7 +4482,8 @@ maybe_t<wcstring> reader_data_t::readline(int nchars_or_0) {
|
||||
|
||||
// Clear the pager if necessary.
|
||||
bool focused_on_search_field = (active_edit_line() == &pager.search_field_line);
|
||||
if (command_ends_paging(readline_cmd, focused_on_search_field)) {
|
||||
if (!history_search.active() &&
|
||||
command_ends_paging(readline_cmd, focused_on_search_field)) {
|
||||
clear_pager();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user