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
This commit is contained in:
Johannes Altmanninger
2022-07-28 10:36:50 +02:00
parent a584fc51d9
commit 1edcd8ab29

View File

@@ -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;