aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/cpphighlighter.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2014-01-18 19:51:57 +0200
committerOrgad Shaneh <orgads@gmail.com>2014-01-20 14:11:18 +0100
commita309b3cfe6173a923988f645aad0488d65589f0f (patch)
tree9b5e3f1999ee37cb356ee722ea9bba0c537dfb9d /src/plugins/cppeditor/cpphighlighter.cpp
parent25ab1199cde5c5590078ec882a76ae6260eca68b (diff)
C++: Store token kind as lexer state
... when needed Change-Id: I32a1649c87e1fa42da80eff5003b2f5714062064 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/cppeditor/cpphighlighter.cpp')
-rw-r--r--src/plugins/cppeditor/cpphighlighter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp
index 06a3c18ce1..fd3d39a182 100644
--- a/src/plugins/cppeditor/cpphighlighter.cpp
+++ b/src/plugins/cppeditor/cpphighlighter.cpp
@@ -66,7 +66,7 @@ CppHighlighter::CppHighlighter(QTextDocument *document) :
void CppHighlighter::highlightBlock(const QString &text)
{
const int previousState = previousBlockState();
- int state = 0, initialBraceDepth = 0;
+ int state = T_EOF_SYMBOL, initialBraceDepth = 0;
if (previousState != -1) {
state = previousState & 0xff;
initialBraceDepth = previousState >> 8;
@@ -96,9 +96,9 @@ void CppHighlighter::highlightBlock(const QString &text)
setCurrentBlockState(previousState);
BaseTextDocumentLayout::clearParentheses(currentBlock());
if (text.length()) {// the empty line can still contain whitespace
- if (initialState == Lexer::State_MultiLineComment)
+ if (initialState == T_COMMENT)
highlightLine(text, 0, text.length(), formatForCategory(CppCommentFormat));
- else if (initialState == Lexer::State_MultiLineDoxyComment)
+ else if (initialState == T_DOXY_COMMENT)
highlightLine(text, 0, text.length(), formatForCategory(CppDoxygenCommentFormat));
else
setFormat(0, text.length(), formatForCategory(CppVisualWhitespace));