From 14aa5dafe5ca432c0ec890d6ad249cdeb60dfcfb Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 27 Apr 2026 22:47:10 +0200 Subject: [PATCH] Add manual section link tooltips. --- profiler/src/profiler/TracyMarkdown.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/profiler/src/profiler/TracyMarkdown.cpp b/profiler/src/profiler/TracyMarkdown.cpp index 29728c64..5474e959 100644 --- a/profiler/src/profiler/TracyMarkdown.cpp +++ b/profiler/src/profiler/TracyMarkdown.cpp @@ -367,6 +367,7 @@ private: void LinkHover() { const auto isSource = link.starts_with( "source:" ) && m_view && m_worker; + const auto isAnchor = link.starts_with( "#" ) && m_view; StringIdx idx; uint32_t line = 0; @@ -404,6 +405,26 @@ private: TextColoredUnformatted( ImVec4( 1.f, 0.f, 0.f, 1.f ), "Invalid source file reference" ); } } + else if( isAnchor ) + { + auto chunk = m_view->GetManualChunk( link.c_str() ); + if( chunk ) + { + if( chunk->section.empty() ) + { + ImGui::TextUnformatted( chunk->title.c_str() ); + } + else + { + ImGui::Text( "%s. %s", chunk->section.c_str(), chunk->title.c_str() ); + } + } + else + { + TextColoredUnformatted( ImVec4( 1.f, 0.f, 0.f, 1.f ), "Invalid manual chunk reference" ); + ImGui::TextUnformatted( link.c_str() ); + } + } else { ImGui::TextUnformatted( link.c_str() );