From 834ff86a643a3665c25468cae2d62c05f2586c0c Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 8 Jan 2021 08:18:07 +0100 Subject: [PATCH] CppEditor: Fix mismatch parentheses highligh in cpp comment ...with continuation line. Fixes: QTCREATORBUG-23297 Change-Id: I6f5ea4184bd991d219efae14fbef090c7874d283 Reviewed-by: Christian Kandeler --- src/plugins/cppeditor/cpphighlighter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp index ecdfbf56d18..ccc50fa1c70 100644 --- a/src/plugins/cppeditor/cpphighlighter.cpp +++ b/src/plugins/cppeditor/cpphighlighter.cpp @@ -183,7 +183,7 @@ void CppHighlighter::highlightBlock(const QString &text) // - 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)) // - 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; // unless we are at the end of the block, we reduce the folding indent if (i == tokens.size()-1)