From e59c5613d30758b5a5d75f16bd1ba5dd13797d93 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 31 Jan 2010 16:55:33 +0100 Subject: [PATCH] fix disabled fancy_scrolling with enabled centered_cursor --- src/screen.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/screen.h b/src/screen.h index 1e4e58f1..ace90ce5 100644 --- a/src/screen.h +++ b/src/screen.h @@ -225,6 +225,7 @@ template void Screen::ReadKey(int &key) template void Screen::Scroll(Where where, const int key[2]) { + List *list = Config.centered_cursor ? dynamic_cast(w) : 0; if (!Config.fancy_scrolling && key) { int in = key[0]; @@ -233,15 +234,19 @@ template void Screen::Scroll(Where where, cons { TraceMpdStatus(); w->Scroll(where); + if (list) + list->Highlight(list->Choice()); w->Refresh(); w->ReadKey(in); } w->SetTimeout(ncmpcpp_window_timeout); } else + { w->Scroll(where); - if (List *list = Config.centered_cursor ? dynamic_cast(w) : 0) - list->Highlight(list->Choice()); + if (list) + list->Highlight(list->Choice()); + } } template void Screen::MouseButtonPressed(MEVENT me)