From 8eadef81a46b18efe617dc6a3cf9af09eb8d596c Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 29 Feb 2020 21:19:28 +0100 Subject: [PATCH] Fix crash on escape in complete-and-search pager Reproduce with `: `. Introduced in 8a033b9f3 Add undo --- src/reader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/reader.cpp b/src/reader.cpp index d72ba03ed..e179d8bc2 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -1963,7 +1963,9 @@ void reader_data_t::set_command_line_and_position(editable_line_t *el, wcstring /// Undo the transient edit und update commandline accordingly. void reader_data_t::clear_transient_edit() { - assert(command_line_has_transient_edit); + if (!command_line_has_transient_edit) { + return; + } command_line.undo(); update_buff_pos(&command_line); command_line_changed(&command_line);