From d701a75563aeca628d5df17ff994db28723219c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Laurent?= <francois.laurent@posteo.net>
Date: Thu, 13 Oct 2022 17:31:11 +0200
Subject: [PATCH] #55: _large-suffixed tags detected together with their
 suffix-free variants

---
 src/files.jl | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/files.jl b/src/files.jl
index 8513f9c..4ba72f1 100644
--- a/src/files.jl
+++ b/src/files.jl
@@ -158,13 +158,19 @@ function tryopenfile(controller, path; reload::Bool=false)
                            )
         fallback_color = theme[:LarvaPlot][:fallback_color]
         existingtags = records.tags
+        # following issue #55, we need to identify situations where _large-suffixed
+        # tags are found together with their suffix-free variants
         apply_default_convention = false
         for tag in existingtags
             if tag in keys(default_convention)
-                apply_default_convention = true
-                break
+                variant, suffix = rsplit(string(tag), '_'; limit=2)
+                if suffix == "large" && Symbol(variant) in existingtags
+                    apply_default_convention = true
+                    break
+                end
             end
         end
+        #
         for tag in existingtags
             active′= tag in keys(default_convention)
             tag′= active′ ? tag : get(related_tags, tag, tag)
-- 
GitLab