Fix brace states

The lexer needs its own lexerState, before it was using
the syntax highlighter user state. This breaks the brace
depth calculation of the highlighter.

Reviewed-by: Roberto Raggi
This commit is contained in:
mae
2010-07-12 11:16:10 +02:00
parent c1d93f4a45
commit ab8a8c018d
5 changed files with 47 additions and 41 deletions

View File

@@ -857,7 +857,7 @@ int CodeFormatter::tokenizeBlock(const QTextBlock &block, bool *endedJoined)
*endedJoined = tokenize.endedJoined();
const int lexerState = tokenize.state();
TextBlockUserData::setLexerState(block, lexerState);
BaseTextDocumentLayout::setLexerState(block, lexerState);
return lexerState;
}
@@ -942,12 +942,12 @@ bool QtStyleCodeFormatter::loadBlockData(const QTextBlock &block, BlockData *dat
void QtStyleCodeFormatter::saveLexerState(QTextBlock *block, int state) const
{
TextBlockUserData::setLexerState(*block, state);
BaseTextDocumentLayout::setLexerState(*block, state);
}
int QtStyleCodeFormatter::loadLexerState(const QTextBlock &block) const
{
return TextBlockUserData::lexerState(block);
return BaseTextDocumentLayout::lexerState(block);
}
void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedIndentDepth) const