aboutsummaryrefslogtreecommitdiffstats
path: root/list_window.c
diff options
context:
space:
mode:
Diffstat (limited to 'list_window.c')
-rw-r--r--list_window.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/list_window.c b/list_window.c
index ab6c7d43b..fa1f94921 100644
--- a/list_window.c
+++ b/list_window.c
@@ -41,6 +41,16 @@ list_window_reset(list_window_t *lw)
lw->clear = 1;
}
+void
+list_window_check_selected(list_window_t *lw, int length)
+{
+ if( lw->selected<0 )
+ lw->selected=0;
+
+ while( lw->selected>0 && length>0 && lw->selected>=length )
+ lw->selected--;
+}
+
void
list_window_set_selected(list_window_t *lw, int n)
{