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.
This commit is contained in:
paxcut
2025-12-30 19:26:44 -07:00
committed by paxcut
parent b57d9118c1
commit 0e2d7ee3bc

View File

@@ -379,7 +379,8 @@ namespace hex::ui {
return m_foldPoints;
}
next(-1);
if (const auto *identifier = const_cast<Token::Identifier *>(getValue<Token::Identifier>(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;