From: Kalle Wallin Date: Fri, 23 Apr 2004 17:04:22 +0000 (+0000) Subject: Make shure the cursor stays on the same row when deleting. X-Git-Tag: v0.12_alpha1~561 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3bfb4ca31c50e4351adac5da7afe31771cbb0734;p=ncmpc.git Make shure the cursor stays on the same row when deleting. git-svn-id: https://svn.musicpd.org/ncmpc/trunk@879 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- diff --git a/screen_play.c b/screen_play.c index cfdfa41..66073d2 100644 --- a/screen_play.c +++ b/screen_play.c @@ -34,8 +34,6 @@ #define BUFSIZE 256 -#define ENABLE_FANCY_PLAYLIST_MANAGMENT - static list_window_t *lw = NULL; static char * @@ -248,7 +246,7 @@ playlist_add_song(mpd_client_t *c, mpd_Song *song) if( mpc_error(c) ) return -1; -#ifdef ENABLE_FANCY_PLAYLIST_MANAGMENT +#ifndef DISABLE_FANCY_PLAYLIST_MANAGMENT /* add the song to playlist */ c->playlist = g_list_append(c->playlist, (gpointer) mpd_songDup(song)); c->playlist_length++; @@ -287,7 +285,7 @@ playlist_delete_song(mpd_client_t *c, int index) /* clear selected highlight in the browse screen */ file_set_highlight(c, song, 0); -#ifdef ENABLE_FANCY_PLAYLIST_MANAGMENT +#ifndef DISABLE_FANCY_PLAYLIST_MANAGMENT /* increment the playlist id, so we dont retrives a new playlist */ c->playlist_id++; @@ -306,6 +304,8 @@ playlist_delete_song(mpd_client_t *c, int index) /* make shure the playlist is repainted */ lw->clear = 1; lw->repaint = 1; + if( lw->start>0 ) + lw->start--; /* make shure we stay on the same row */ list_window_check_selected(lw, c->playlist_length); #endif