aboutsummaryrefslogtreecommitdiffstats
path: root/list_window.c
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-03-27 16:22:04 +0000
committerKalle Wallin <kaw@linux.se>2004-03-27 16:22:04 +0000
commit31832b2c38d5decb81e7aad84e39dbfe12a9392c (patch)
treea8bffa0fcadecdff8f5379983da0470d1a0cb3a9 /list_window.c
parentd34028b356f2d4d29e5e5f40229117d6bad8e618 (diff)
downloadmpd-31832b2c38d5decb81e7aad84e39dbfe12a9392c.tar.gz
mpd-31832b2c38d5decb81e7aad84e39dbfe12a9392c.tar.xz
mpd-31832b2c38d5decb81e7aad84e39dbfe12a9392c.zip
Added function list_window_check_selected().
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@510 09075e82-0dd4-0310-85a5-a0d7c8717e4f
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)
{