summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2010-03-01 13:43:26 (GMT)
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2010-03-02 09:59:11 (GMT)
commit6d51c7b9d1f6700564ec9e3c3f7b41b6b94a74da (patch)
treeef1c6fc68ca9a498cf0941ceed8430fa62d189f2 /src/gui/text
parent340eb4f20a5976be77ee66bbfc2ef16c97b033d2 (diff)
downloadQt-6d51c7b9d1f6700564ec9e3c3f7b41b6b94a74da.zip
Qt-6d51c7b9d1f6700564ec9e3c3f7b41b6b94a74da.tar.gz
Qt-6d51c7b9d1f6700564ec9e3c3f7b41b6b94a74da.tar.bz2
don't cancel the scheduled complete rehighlight from rehighlightBlock()
if rehighlightBlock() is called just after setDocument() then it is possible that reformatBlocks() will be called just before q_delayedRehighlight() and thus will prevent previously scheduled complete rehighlighting. Merge-request: 481 Reviewed-by: Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qsyntaxhighlighter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp
index 9b3671d..b5a7aa1 100644
--- a/src/gui/text/qsyntaxhighlighter.cpp
+++ b/src/gui/text/qsyntaxhighlighter.cpp
@@ -402,8 +402,13 @@ void QSyntaxHighlighter::rehighlightBlock(const QTextBlock &block)
if (!d->doc)
return;
+ const bool rehighlightPending = d->rehighlightPending;
+
QTextCursor cursor(block);
d->rehighlight(cursor, QTextCursor::EndOfBlock);
+
+ if (rehighlightPending)
+ d->rehighlightPending = rehighlightPending;
}
/*!