CppEditor: Fix mismatch parentheses highligh in cpp comment

...with continuation line.

Fixes: QTCREATORBUG-23297
Change-Id: I6f5ea4184bd991d219efae14fbef090c7874d283
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2021-01-08 08:18:07 +01:00
parent 1df9951d03
commit 834ff86a64

View File

@@ -183,7 +183,7 @@ void CppHighlighter::highlightBlock(const QString &text)
// - the line starts in a C Comment (initalState != 0) // - the line starts in a C Comment (initalState != 0)
// - the first token of the line is a T_COMMENT (i == 0 && tk.is(T_COMMENT)) // - the first token of the line is a T_COMMENT (i == 0 && tk.is(T_COMMENT))
// - is not a continuation line (tokens.size() > 1 || !state) // - is not a continuation line (tokens.size() > 1 || !state)
if (initialLexerState && i == 0 && (tokens.size() > 1 || !lexerState)) { if (initialLexerState && i == 0 && tk.is(T_COMMENT) && (tokens.size() > 1 || !lexerState)) {
--braceDepth; --braceDepth;
// unless we are at the end of the block, we reduce the folding indent // unless we are at the end of the block, we reduce the folding indent
if (i == tokens.size()-1) if (i == tokens.size()-1)