From 12a9cb294003e8d88571586fd38831f03b8a73b6 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 8 Feb 2020 08:55:02 +0100 Subject: [PATCH] Fix assertion failure on page up / page down I had overlooked {beginning,end}-of-history which don't search. --- src/reader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/reader.cpp b/src/reader.cpp index d5f970b91..363c2c628 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -1997,10 +1997,10 @@ void reader_data_t::update_command_line_from_history_search() { } if (history_search.by_token()) { replace_current_token(std::move(new_text)); - } else { - assert((history_search.by_line() || history_search.by_prefix()) && - "Unknown history search type"); + } else if (history_search.by_line() || history_search.by_prefix()) { el->replace_substring(0, el->size(), std::move(new_text)); + } else { + return; } command_line_has_transient_edit = true; assert(el == &command_line);