From 61074b6b5c49199c56f9d34aa508f2cc65b2a41b Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Sun, 8 Jan 2023 22:07:39 +0000 Subject: [PATCH] Help: Update browse view when opening a new help page The browse view now always tracks the currently open help page. --- Userland/Applications/Help/MainWidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/Help/MainWidget.cpp b/Userland/Applications/Help/MainWidget.cpp index 216df68771..8f2fb0037f 100644 --- a/Userland/Applications/Help/MainWidget.cpp +++ b/Userland/Applications/Help/MainWidget.cpp @@ -250,7 +250,10 @@ void MainWidget::open_url(URL const& url) GUI::Application::the()->deferred_invoke([&, path = url.path()] { auto browse_view_index = m_manual_model->index_from_path(path); if (browse_view_index.has_value()) { - m_browse_view->expand_all_parents_of(browse_view_index.value()); + if (browse_view_index.value() != m_browse_view->selection_start_index()) { + m_browse_view->expand_all_parents_of(browse_view_index.value()); + m_browse_view->set_cursor(browse_view_index.value(), GUI::AbstractView::SelectionUpdate::Set); + } auto page_and_section = m_manual_model->page_and_section(browse_view_index.value()); if (!page_and_section.has_value())