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)