diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2014-02-08 23:42:36 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2014-03-03 14:09:32 +0100 |
commit | 474065c5c7c3d7de3332f5d3371b28713df8becf (patch) | |
tree | 6c7a2d91d3fe1db0f422a68b404f148677c50c99 /src/plugins/cppeditor/cpphighlighter.cpp | |
parent | e5a693be96c3134d2a14a425c5c383f886627c93 (diff) |
CppEditor: Do not "highlight parentheses" for multiline C++ comments
Change-Id: I6c84a2653a1e9c13e1c776b49b4e51cb4de772f3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Diffstat (limited to 'src/plugins/cppeditor/cpphighlighter.cpp')
-rw-r--r-- | src/plugins/cppeditor/cpphighlighter.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp index 33dcc28532..fe1bfb89d5 100644 --- a/src/plugins/cppeditor/cpphighlighter.cpp +++ b/src/plugins/cppeditor/cpphighlighter.cpp @@ -224,10 +224,13 @@ void CppHighlighter::highlightBlock(const QString &text) if (text.length() > lastTokenEnd) highlightLine(text, lastTokenEnd, text.length() - lastTokenEnd, formatForCategory(CppVisualWhitespace)); - if (!initialLexerState && lexerState && !tokens.isEmpty() && tokens.last().isComment()) { - parentheses.append(Parenthesis(Parenthesis::Opened, QLatin1Char('+'), - tokens.last().begin())); - ++braceDepth; + if (!initialLexerState && lexerState && !tokens.isEmpty()) { + const Token &lastToken = tokens.last(); + if (lastToken.is(T_COMMENT) || lastToken.is(T_DOXY_COMMENT)) { + parentheses.append(Parenthesis(Parenthesis::Opened, QLatin1Char('+'), + lastToken.begin())); + ++braceDepth; + } } BaseTextDocumentLayout::setParentheses(currentBlock(), parentheses); |