diff --git a/plugins/builtin/source/content/text_highlighting/pattern_language.cpp b/plugins/builtin/source/content/text_highlighting/pattern_language.cpp index 7b0737f45..c43e5f6ab 100644 --- a/plugins/builtin/source/content/text_highlighting/pattern_language.cpp +++ b/plugins/builtin/source/content/text_highlighting/pattern_language.cpp @@ -1575,7 +1575,9 @@ namespace hex::plugin::builtin { void TextHighlighter::setRequestedIdentifierColors() { auto topLine = 0; - auto bottomLine = m_lines.size(); + while (m_firstTokenIdOfLine.at(topLine) == -1) + topLine++; + auto bottomLine = previousLine(m_firstTokenIdOfLine.size()); for (u32 line = topLine; line < bottomLine; line = nextLine(line)) { if (m_lines[line].empty()) continue;