From 0e2d7ee3bc0fd1f2204ebfb7526b3123c9b64af3 Mon Sep 17 00:00:00 2001 From: paxcut Date: Tue, 30 Dec 2025 19:26:44 -0700 Subject: [PATCH] fix: template argument delimiters failed to create folds. The problem was using the identifier type to distinguish template delimiters from operators because types are not guaranteed to be set. The fix uses colors of the highlighting instead which should always be set when the folds are detected. --- plugins/ui/source/ui/text_editor/codeFolder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/ui/source/ui/text_editor/codeFolder.cpp b/plugins/ui/source/ui/text_editor/codeFolder.cpp index 057424e23..ee21b308e 100644 --- a/plugins/ui/source/ui/text_editor/codeFolder.cpp +++ b/plugins/ui/source/ui/text_editor/codeFolder.cpp @@ -379,7 +379,8 @@ namespace hex::ui { return m_foldPoints; } next(-1); - if (const auto *identifier = const_cast(getValue(0)); identifier == nullptr || identifier->getType() != Token::Identifier::IdentifierType::UDT) { + auto column = m_curr[0].location.column - 1; + if (line.m_colors[column] != (char) PaletteIndex::UserDefinedType) { next(2); if (peek(tkn::Separator::EndOfProgram, -1)) { return m_foldPoints;