From 5792e4a12bceac64d5cd03c6bc06d9886a6b1033 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Mon, 9 Jan 2023 21:39:55 +0100 Subject: [PATCH] Make history pager use more entries (#9458) Like I mentioned in #9089, 12 entries is a bit few. So, instead, we do like we do for completions before disclosing and pick half the screen (but at least X, in this case 12). This avoids filling the entire screen, and will avoid an unsightly "X more entries" (which requires scrolling down to fully disclose) because it matches what the pager does. Note: For multiline commands we can be pushed further upwards, and in case of a multi-column layout we could fit more lines. That would require asking the pager to fit as many as possible and give us back the index of the last matching entry and rewinding the history search. That's gonna be left as an exercise for later if it turns out to be necessary. --- src/reader.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/reader.cpp b/src/reader.cpp index c50426ff8..1df9b509c 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -1277,9 +1277,14 @@ static history_pager_result_t history_pager_search(const std::shared_ptr