Fix logical XOR

The '^' is the bitwise XOR, we should use logical XOR in
these contexts. The operator!=() should serve for it.

More info and reasoning:
https://stackoverflow.com/questions/24542

Change-Id: I1bd70bdcab25455f409594f0f14c209d1de11d18
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-09-30 18:45:35 +02:00
parent 0c39484b60
commit bc4c1faf73
6 changed files with 9 additions and 8 deletions

View File

@@ -299,7 +299,8 @@ void Highlighter::highlightBlock(const QString &text)
TextBlockUserData *data = TextDocumentLayout::userData(nextBlock);
if (data->syntaxState() != state) {
data->setSyntaxState(state);
setCurrentBlockState(currentBlockState() ^ 1); // force rehighlight of next block
// Toggles the LSB of current block's userState. It forces rehighlight of next block.
setCurrentBlockState(currentBlockState() ^ 1);
}
data->setFoldingIndent(TextDocumentLayout::braceDepth(block));
}