From: Max Kellermann Date: Tue, 23 Sep 2008 11:29:25 +0000 (+0200) Subject: screen_play: use list_window_check_selected() X-Git-Tag: v0.12_alpha1~172 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3b68c580d50a22d6b0716948128cf359defab317;p=ncmpc.git screen_play: use list_window_check_selected() Instead of manually adjusting the selection, let list_window.c do it. --- diff --git a/src/screen_play.c b/src/screen_play.c index 625e953..265ca4d 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -400,11 +400,7 @@ play_update(screen_t *screen, mpdclient_t *c) } if (c->playlist.id != playlist_id) { - if (lw->selected >= c->playlist.list->len) - lw->selected = c->playlist.list->len - 1; - if (lw->start >= c->playlist.list->len) - list_window_reset(lw); - + list_window_check_selected(lw, playlist_length(&c->playlist)); play_paint(screen, c); playlist_id = c->playlist.id; } else {