aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--list_window.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/list_window.c b/list_window.c
index b04b817da..334f7f6eb 100644
--- a/list_window.c
+++ b/list_window.c
@@ -48,6 +48,9 @@ list_window_check_selected(list_window_t *lw, int length)
if( lw->selected<0 )
lw->selected=0;
+ while( lw->selected<lw->start )
+ lw->selected++;
+
while( lw->selected>0 && length>0 && lw->selected>=length )
lw->selected--;
}