From 366bbd654876bae26c1108b75f95efd41aec67eb Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Tue, 21 Aug 2018 14:14:39 +0200 Subject: [PATCH] ui: Fixed local reference navigation not shown for edge clicks when file content was not present yet --- src/lib_gui/qt/element/QtCodeNavigator.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/lib_gui/qt/element/QtCodeNavigator.cpp b/src/lib_gui/qt/element/QtCodeNavigator.cpp index 92b9af97..5601d887 100644 --- a/src/lib_gui/qt/element/QtCodeNavigator.cpp +++ b/src/lib_gui/qt/element/QtCodeNavigator.cpp @@ -552,9 +552,6 @@ void QtCodeNavigator::showActiveSnippet( ); } - setActiveLocalTokenIds({ tokenId }, LOCATION_TOKEN); - updateFiles(); - if (m_mode == MODE_LIST) { for (const FilePath& filePath : filePathsToExpand) @@ -567,6 +564,9 @@ void QtCodeNavigator::showActiveSnippet( m_single->requestFileContent(firstReference.filePath); } + setActiveLocalTokenIds({ tokenId }, LOCATION_TOKEN); + updateFiles(); + if (firstReference.tokenId) { if (scrollTo) @@ -660,6 +660,13 @@ void QtCodeNavigator::showContents() } m_current->showContents(); + + // look for local references again, in case file content was not present when local symbols were activated + if (m_activeLocalTokenIds.size() && !m_localReferences.size()) + { + setActiveLocalTokenIds(utility::toVector(m_activeLocalTokenIds), LOCATION_TOKEN); + updateRefLabels(); + } } size_t QtCodeNavigator::findScreenMatches(const std::wstring& query)