summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2009-09-16 12:15:27 (GMT)
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-09-17 12:13:24 (GMT)
commitf2d5e83afcc30de4d77b30f90df6f82e53796d59 (patch)
tree9d7a463d096d972dd47a6ee47302529344eb5495 /src/gui
parent9f587663a8d64df683381292b6cf80f9e48bb989 (diff)
downloadQt-f2d5e83afcc30de4d77b30f90df6f82e53796d59.zip
Qt-f2d5e83afcc30de4d77b30f90df6f82e53796d59.tar.gz
Qt-f2d5e83afcc30de4d77b30f90df6f82e53796d59.tar.bz2
Fix to QSyntaxHighlighter not rehighlighting enough
When entire blocks get deleted, the last block for rehighlighting would be the block _before_ the deleted blocks. This is wrong, since the deleted blocks could have contained characters which affect the state. The patch lets the highlighter check for one more character. Reviewed-by: thorbjorn (cherry picked from commit fd2090b925f46bc0dfffd34612a9bfcd276c3266)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qsyntaxhighlighter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp
index 41f4b4a..470c8e1 100644
--- a/src/gui/text/qsyntaxhighlighter.cpp
+++ b/src/gui/text/qsyntaxhighlighter.cpp
@@ -170,7 +170,7 @@ void QSyntaxHighlighterPrivate::_q_reformatBlocks(int from, int charsRemoved, in
return;
int endPosition;
- QTextBlock lastBlock = doc->findBlock(from + charsAdded);
+ QTextBlock lastBlock = doc->findBlock(from + charsAdded + (charsRemoved > 0 ? 1 : 0));
if (lastBlock.isValid())
endPosition = lastBlock.position() + lastBlock.length();
else