From: jefromi Date: Thu, 12 Feb 2009 14:34:00 +0000 (+0100) Subject: screen_play: move selection when moving a single song in playlist X-Git-Tag: release-0.14~92 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=288d700ef90de4215b88eb77f7457db65cf67793;p=ncmpc.git screen_play: move selection when moving a single song in playlist Selection didn't move when moving a single song in playlist. Introduced by the visual selection - selection is only updated when moving in visual mode, not when moving a single song (nonvisual mode). --- diff --git a/src/screen_play.c b/src/screen_play.c index 75b0f2e..c69f64c 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -624,7 +624,12 @@ play_cmd(mpdclient_t *c, command_t cmd) lw->visual_base--; } else + { mpdclient_cmd_move(c, lw->selected, lw->selected-1); + lw->selected--; + lw->selected_start--; + lw->selected_end--; + } return true; case CMD_LIST_MOVE_DOWN: if(lw->selected_end+1 >= playlist_length(&c->playlist)) @@ -641,7 +646,12 @@ play_cmd(mpdclient_t *c, command_t cmd) lw->visual_base++; } else + { mpdclient_cmd_move(c, lw->selected, lw->selected+1); + lw->selected++; + lw->selected_start++; + lw->selected_end++; + } return true; case CMD_LIST_FIND: case CMD_LIST_RFIND: