forked from qt-creator/qt-creator
QmlJS: Don't unnecessarily store the multiline comment state.
The 'state' value already holds the same information. Reviewed-by: Erik Verbruggen
This commit is contained in:
@@ -326,8 +326,8 @@ int Highlighter::onBlockStart()
|
|||||||
int previousState = previousBlockState();
|
int previousState = previousBlockState();
|
||||||
if (previousState != -1) {
|
if (previousState != -1) {
|
||||||
state = previousState & 0xff;
|
state = previousState & 0xff;
|
||||||
m_inMultilineComment = (previousState >> 8) & 0xff;
|
m_braceDepth = previousState >> 8;
|
||||||
m_braceDepth = previousState >> 16;
|
m_inMultilineComment = (state == Scanner::MultiLineComment);
|
||||||
}
|
}
|
||||||
m_foldingIndent = m_braceDepth;
|
m_foldingIndent = m_braceDepth;
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ void Highlighter::onBlockEnd(int state)
|
|||||||
{
|
{
|
||||||
typedef TextEditor::TextBlockUserData TextEditorBlockData;
|
typedef TextEditor::TextBlockUserData TextEditorBlockData;
|
||||||
|
|
||||||
setCurrentBlockState((m_braceDepth << 16) | (m_inMultilineComment << 8) | state);
|
setCurrentBlockState((m_braceDepth << 8) | state);
|
||||||
TextEditor::BaseTextDocumentLayout::setParentheses(currentBlock(), m_currentBlockParentheses);
|
TextEditor::BaseTextDocumentLayout::setParentheses(currentBlock(), m_currentBlockParentheses);
|
||||||
TextEditor::BaseTextDocumentLayout::setFoldingIndent(currentBlock(), m_foldingIndent);
|
TextEditor::BaseTextDocumentLayout::setFoldingIndent(currentBlock(), m_foldingIndent);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user