Commit 70448b01 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS: Don't unnecessarily store the multiline comment state.

The 'state' value already holds the same information.

Reviewed-by: Erik Verbruggen
parent 3029a295
...@@ -326,8 +326,8 @@ int Highlighter::onBlockStart() ...@@ -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) ...@@ -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);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment