Skip to content
Snippets Groups Projects
Commit 983ed48a 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
(backport of 70448b01)
parent 83dba068
No related branches found
No related tags found
No related merge requests found
...@@ -313,9 +313,9 @@ int Highlighter::onBlockStart() ...@@ -313,9 +313,9 @@ int Highlighter::onBlockStart()
int state = 0; int state = 0;
int previousState = previousBlockState(); int previousState = previousBlockState();
if (previousState != -1) { if (previousState != -1) {
m_inMultilineComment = previousState & 0x1; state = previousState & 0xff;
state = (previousState >> 1) & 0xff; m_braceDepth = (previousState >> 8);
m_braceDepth = (previousState >> 9); m_inMultilineComment = (state == Scanner::MultiLineComment);
} }
return state; return state;
...@@ -325,7 +325,7 @@ void Highlighter::onBlockEnd(int state, int firstNonSpace) ...@@ -325,7 +325,7 @@ void Highlighter::onBlockEnd(int state, int firstNonSpace)
{ {
typedef TextEditor::TextBlockUserData TextEditorBlockData; typedef TextEditor::TextBlockUserData TextEditorBlockData;
setCurrentBlockState((m_braceDepth << 9) | (state << 1) | m_inMultilineComment); setCurrentBlockState((m_braceDepth << 8) | state);
// Set block data parentheses. Force creation of block data unless empty // Set block data parentheses. Force creation of block data unless empty
TextEditorBlockData *blockData = 0; TextEditorBlockData *blockData = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment