diff --git a/doc/config b/doc/config index 7f6d72fb..dbe02188 100644 --- a/doc/config +++ b/doc/config @@ -225,6 +225,8 @@ # #autocenter_mode = "no" # +#centered_cursor = "no" +# #progressbar_look = "=>" # #default_place_to_search_in = "database" (database/playlist) diff --git a/doc/ncmpcpp.1 b/doc/ncmpcpp.1 index c4907d63..a3cfcba2 100644 --- a/doc/ncmpcpp.1 +++ b/doc/ncmpcpp.1 @@ -180,6 +180,9 @@ If enabled, statusbar will be displayed, otherwise hidden. .B autocenter_mode = yes/no Default state for autocenter mode at start. .TP +.B centered_cursor = yes/no +If enabled, currently highlighted position in the list will be always centered. +.TP .B progressbar_look = TEXT This variable defines the look of progressbar. Note that it has to be exactly two characters long. .TP diff --git a/src/screen.h b/src/screen.h index b123f011..b0f00cd2 100644 --- a/src/screen.h +++ b/src/screen.h @@ -235,6 +235,8 @@ template void Screen::Scroll(Where where, cons } else w->Scroll(where); + if (List *list = Config.centered_cursor ? dynamic_cast(w) : 0) + list->Highlight(list->Choice()); } template void Screen::MouseButtonPressed(MEVENT me) diff --git a/src/settings.cpp b/src/settings.cpp index b2d6a39a..d9f22163 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -293,6 +293,7 @@ void DefaultConfiguration(ncmpcpp_config &conf) conf.header_visibility = true; conf.header_text_scrolling = true; conf.statusbar_visibility = true; + conf.centered_cursor = false; conf.autocenter_mode = false; conf.wrapped_search = true; conf.space_selects = false; @@ -756,6 +757,10 @@ void ReadConfiguration(ncmpcpp_config &conf) { conf.autocenter_mode = v == "yes"; } + else if (cl.find("centered_cursor") != std::string::npos) + { + conf.centered_cursor = v == "yes"; + } else if (cl.find("default_find_mode") != std::string::npos) { conf.wrapped_search = v == "wrapped"; diff --git a/src/settings.h b/src/settings.h index 89aa48dd..2fcce887 100644 --- a/src/settings.h +++ b/src/settings.h @@ -186,6 +186,7 @@ struct ncmpcpp_config bool header_visibility; bool header_text_scrolling; bool statusbar_visibility; + bool centered_cursor; bool autocenter_mode; bool wrapped_search; bool space_selects;