diff options
author | Ritt Konstantin <ritt.ks@gmail.com> | 2010-03-01 13:43:26 (GMT) |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-03-02 09:59:11 (GMT) |
commit | 6d51c7b9d1f6700564ec9e3c3f7b41b6b94a74da (patch) | |
tree | ef1c6fc68ca9a498cf0941ceed8430fa62d189f2 | |
parent | 340eb4f20a5976be77ee66bbfc2ef16c97b033d2 (diff) | |
download | Qt-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>
-rw-r--r-- | src/gui/text/qsyntaxhighlighter.cpp | 5 |
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; } /*! |