aboutsummaryrefslogtreecommitdiffhomepage
path: root/pager.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-19 23:52:35 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-19 23:52:35 -0800
commit998ce1fe89800994fb378e5f2c5554dcab6782fb (patch)
tree70a2498a5d2e0689bf7c63abf6932a29cf7876c3 /pager.cpp
parentd9d65577f4f2f7ca7b3866c10c44136c75d6e6ef (diff)
Support for correctly resizing pager contents.
Diffstat (limited to 'pager.cpp')
-rw-r--r--pager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/pager.cpp b/pager.cpp
index 3d311b85..9b1676e9 100644
--- a/pager.cpp
+++ b/pager.cpp
@@ -937,7 +937,7 @@ void pager_t::update_rendering(page_rendering_t *rendering) const
}
}
-pager_t::pager_t() : term_width(0), term_height(0), selected_completion_idx(-1)
+pager_t::pager_t() : term_width(0), term_height(0), selected_completion_idx(PAGER_SELECTION_NONE)
{
}
@@ -978,7 +978,7 @@ const completion_t *pager_t::select_next_completion_in_direction(selection_direc
if (direction == direction_next)
{
new_selected_completion_idx = selected_completion_idx + 1;
- if (new_selected_completion_idx > completion_infos.size())
+ if (new_selected_completion_idx >= completion_infos.size())
{
new_selected_completion_idx = 0;
}
@@ -1128,6 +1128,7 @@ void pager_t::clear()
completions.clear();
completion_infos.clear();
prefix.clear();
+ selected_completion_idx = PAGER_SELECTION_NONE;
}
page_rendering_t::page_rendering_t() : term_width(-1), term_height(-1), rows(0), cols(0), selected_completion_idx(-1)