From: Jonathan Neuschäfer Date: Sat, 17 Sep 2011 20:16:50 +0000 (+0200) Subject: screen_queue: fix CMD_LIST_MOVE_* X-Git-Tag: release-0.20~87^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d71be00d7bbd135c1cd7ec2cfe38774a8a0b373f;p=ncmpc.git screen_queue: fix CMD_LIST_MOVE_* The code now tries to keep as much as possible of the selection being moved visible. --- diff --git a/src/screen_queue.c b/src/screen_queue.c index 37a6050..335bb17 100644 --- a/src/screen_queue.c +++ b/src/screen_queue.c @@ -765,6 +765,10 @@ screen_queue_cmd(struct mpdclient *c, command_t cmd) lw->selected--; lw->range_base--; + if (lw->range_selection) + list_window_scroll_to(lw, lw->range_base); + list_window_scroll_to(lw, lw->selected); + screen_queue_save_selection(); return true; @@ -779,6 +783,10 @@ screen_queue_cmd(struct mpdclient *c, command_t cmd) lw->selected++; lw->range_base++; + if (lw->range_selection) + list_window_scroll_to(lw, lw->range_base); + list_window_scroll_to(lw, lw->selected); + screen_queue_save_selection(); return true;