Code

Fixed list_window_check_selected().
authorKalle Wallin <kaw@linux.se>
Thu, 22 Apr 2004 20:38:28 +0000 (20:38 +0000)
committerKalle Wallin <kaw@linux.se>
Thu, 22 Apr 2004 20:38:28 +0000 (20:38 +0000)
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@876 09075e82-0dd4-0310-85a5-a0d7c8717e4f

list_window.c

index d0fcaa58e1cd078470b945c0df0af41a24b4d965..b251310be228bbfa397dcf5c8a9224ebca81dd5b 100644 (file)
@@ -64,6 +64,9 @@ list_window_reset(list_window_t *lw)
 void
 list_window_check_selected(list_window_t *lw, int length)
 {
+  while( lw->start && lw->start+lw->rows>length)
+    lw->start--;
+
   if( lw->selected<0 )
     lw->selected=0;
 
@@ -175,6 +178,7 @@ list_window_paint(list_window_t *lw,
          if( lw->start+i == lw->selected )
            wattroff(lw->w, A_REVERSE);
        }
+       
     }
   lw->clear=0;
 }