From 9dca2847cbd69bbddd7c063e8eae2121eb54e79d Mon Sep 17 00:00:00 2001 From: xFrednet Date: Fri, 1 Nov 2024 16:53:52 +0100 Subject: [PATCH] Mermaid: Make unreachable highlighting optional --- src/rt/ui.h | 1 + src/rt/ui/mermaid.cc | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rt/ui.h b/src/rt/ui.h index 7e86a91..163336e 100644 --- a/src/rt/ui.h +++ b/src/rt/ui.h @@ -60,6 +60,7 @@ namespace rt::ui bool draw_immutable_region; /// Indicates if local functions should be visible bool draw_funcs; + bool highlight_unreachable = true; std::vector error_objects; std::vector error_edges; diff --git a/src/rt/ui/mermaid.cc b/src/rt/ui/mermaid.cc index 79c0d4c..0063d0d 100644 --- a/src/rt/ui/mermaid.cc +++ b/src/rt/ui/mermaid.cc @@ -84,7 +84,6 @@ namespace rt::ui // Give a nice id to each object. std::map nodes; - std::map> region_strings; std::map regions; public: @@ -198,8 +197,10 @@ namespace rt::ui // Footer out << markers.second; out - << (dst->is_immutable() ? ":::immutable" : - (reachable ? "" : ":::unreachable")); + << (dst->is_immutable() ? + ":::immutable" : + (reachable && info->highlight_unreachable ? "" : + ":::unreachable")); out << std::endl; result = node; @@ -503,6 +504,7 @@ namespace rt::ui { // Make sure ui doesn't pause steps += 10; + highlight_unreachable = false; // Construct message std::stringstream ss;