CppEditor: Do not "highlight parentheses" for multiline C++ comments

Change-Id: I6c84a2653a1e9c13e1c776b49b4e51cb4de772f3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Orgad Shaneh
2014-02-08 23:42:36 +02:00
committed by Orgad Shaneh
parent e5a693be96
commit 474065c5c7

View File

@@ -224,10 +224,13 @@ void CppHighlighter::highlightBlock(const QString &text)
if (text.length() > lastTokenEnd) if (text.length() > lastTokenEnd)
highlightLine(text, lastTokenEnd, text.length() - lastTokenEnd, formatForCategory(CppVisualWhitespace)); highlightLine(text, lastTokenEnd, text.length() - lastTokenEnd, formatForCategory(CppVisualWhitespace));
if (!initialLexerState && lexerState && !tokens.isEmpty() && tokens.last().isComment()) { if (!initialLexerState && lexerState && !tokens.isEmpty()) {
parentheses.append(Parenthesis(Parenthesis::Opened, QLatin1Char('+'), const Token &lastToken = tokens.last();
tokens.last().begin())); if (lastToken.is(T_COMMENT) || lastToken.is(T_DOXY_COMMENT)) {
++braceDepth; parentheses.append(Parenthesis(Parenthesis::Opened, QLatin1Char('+'),
lastToken.begin()));
++braceDepth;
}
} }
BaseTextDocumentLayout::setParentheses(currentBlock(), parentheses); BaseTextDocumentLayout::setParentheses(currentBlock(), parentheses);