Commit transient edit when closing pager

When selecting items in the pager, only the latest of those items is kept
in the edit history, as so-called transient edit.  Each new transient edit
evicts any old transient edit (via undo).

If the pager is closed by a command that performs another transient edit
(like history-token-search-backward) we thus inadvertently undo (= remove)
the token inserted by the pager.  Fix this by closing a transient edit
session when closing the pager.  Token search will start its own session.

Fixes #9160
This commit is contained in:
Johannes Altmanninger
2022-08-31 07:33:46 +02:00
parent a6ff72bd64
commit 3b30d92b62
2 changed files with 7 additions and 0 deletions

View File

@@ -2045,6 +2045,7 @@ void reader_data_t::accept_autosuggestion(bool full, bool single, move_word_styl
void reader_data_t::clear_pager() {
pager.clear();
history_pager_active = false;
command_line_has_transient_edit = false;
}
void reader_data_t::select_completion_in_direction(selection_motion_t dir,