Code

screen_queue: use list_window_move_cursor
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 31 Aug 2011 12:27:52 +0000 (14:27 +0200)
committerJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 31 Aug 2011 12:40:00 +0000 (14:40 +0200)
It ensures the cursor stays visible.

src/screen_queue.c

index 37a60500eea74a6006237af072d93bcfe68a8d76..863c3dd5f38442e6e432a58d90d8038321869acb 100644 (file)
@@ -762,8 +762,7 @@ screen_queue_cmd(struct mpdclient *c, command_t cmd)
                if (!mpdclient_cmd_move(c, range.end - 1, range.start - 1))
                        return true;
 
-               lw->selected--;
-               lw->range_base--;
+               list_window_move_cursor(lw, lw->selected - 1);
 
                screen_queue_save_selection();
                return true;
@@ -776,8 +775,7 @@ screen_queue_cmd(struct mpdclient *c, command_t cmd)
                if (!mpdclient_cmd_move(c, range.start, range.end))
                        return true;
 
-               lw->selected++;
-               lw->range_base++;
+               list_window_move_cursor(lw, lw->selected + 1);
 
                screen_queue_save_selection();
                return true;