From: Patrick Hallen Date: Fri, 4 Sep 2009 21:00:54 +0000 (+0200) Subject: screen_play: Fixed the scrolling in the playlist screen. X-Git-Tag: release-0.15~24^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=793851b4f65e4b19a59d60e5fa1a68a98b359ca5;p=ncmpc.git screen_play: Fixed the scrolling in the playlist screen. Since commit 850ad87b588dd6cbb96e5558ee671f2c95cc839d, which introduced a second column with the length of the song in the playlist screen, scrolling of the entries would sometimes not work, if the entry was smaller than the screen, but bigger than the first column. This easy patch fixes this by using the real size of the first column to decide whether to start scrolling. --- diff --git a/src/screen_play.c b/src/screen_play.c index fe9b5c2..46ad68e 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -129,7 +129,7 @@ list_callback(unsigned idx, bool *highlight, char **second_column, G_GNUC_UNUSED if (idx == lw->selected) { - if (options.scroll && utf8_width(songname) > (unsigned)COLS) + if (options.scroll && utf8_width(songname) > (unsigned)(COLS - strlen(*second_column) - 1) ) { static unsigned current_song; char *tmp;