forked from qt-creator/qt-creator
C++: Fix support for incremental input with \n
Also fix false positive line continuation on blank line e.g. "foo \ bar" Change-Id: Ic6d345a4b578c955411d119b8438c8dc5065c072 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
fd31b4716c
commit
e600424648
@@ -70,7 +70,8 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
|
||||
restoreCurrentState(block.previous());
|
||||
|
||||
bool endedJoined = false;
|
||||
const int lexerState = tokenizeBlock(block, &endedJoined);
|
||||
// Discard newline expected bit from state
|
||||
const int lexerState = tokenizeBlock(block, &endedJoined) & ~0x80;
|
||||
m_tokenIndex = 0;
|
||||
m_newStates.clear();
|
||||
|
||||
@@ -504,7 +505,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
|
||||
leave();
|
||||
continue;
|
||||
} else if (m_tokenIndex == m_tokens.size() - 1
|
||||
&& lexerState == T_EOF_SYMBOL) {
|
||||
&& lexerState == 0) {
|
||||
leave();
|
||||
} else if (m_tokenIndex == 0 && m_currentToken.isComment()) {
|
||||
// to allow enter/leave to update the indentDepth
|
||||
|
||||
Reference in New Issue
Block a user