From 1edcd8ab29dd87c8b562430d0087e242ed93e43e Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Thu, 28 Jul 2022 10:36:50 +0200 Subject: [PATCH] Fix "commandline --paging-mode" false negative when there is no room for pager The pager still works even if there is no room to render it. So let's make "commandline --paging-mode" return true if there is an off-screen pager. This fixes the problem with the upcoming history-pager described in https://github.com/fish-shell/fish-shell/pull/9089#issuecomment-1196945456 --- src/reader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reader.cpp b/src/reader.cpp index 654a02074..21b511f30 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -2798,7 +2798,7 @@ void reader_data_t::update_commandline_state() const { snapshot->cursor_pos = this->command_line.position(); snapshot->history = this->history; snapshot->selection = this->get_selection(); - snapshot->pager_mode = !this->current_page_rendering.screen_data.empty(); + snapshot->pager_mode = this->is_navigating_pager_contents(); snapshot->pager_fully_disclosed = this->current_page_rendering.remaining_to_disclose == 0; snapshot->search_mode = this->history_search.active(); snapshot->initialized = true;