aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2005-09-10 00:40:26 +0000
committernyamatongwe <unknown>2005-09-10 00:40:26 +0000
commita110498be71cc77ffe566c1dff1e5c33516cfbfe (patch)
treead2001d7fff870d89f5218303916b2a15226b6ff
parent68276604baeb6a9a3c6cf6b17d02fd68af69c7e8 (diff)
downloadscintilla-mirror-a110498be71cc77ffe566c1dff1e5c33516cfbfe.tar.gz
Reduced range of styling modification notification so that out of region
painting is less likely, so painting will complete without triggering a full repaint. This was a problem with some lexers that backtracked to see if the line before a modification needed restyling.
-rw-r--r--src/Document.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 8e78f5b46..27260d6d4 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -1309,19 +1309,22 @@ bool Document::SetStyles(int length, char *styles) {
return false;
} else {
enteredCount++;
- int prevEndStyled = endStyled;
bool didChange = false;
- int lastChange = 0;
+ int startMod = 0;
+ int endMod = 0;
for (int iPos = 0; iPos < length; iPos++, endStyled++) {
PLATFORM_ASSERT(endStyled < Length());
if (cb.SetStyleAt(endStyled, styles[iPos], stylingMask)) {
+ if (!didChange) {
+ startMod = endStyled;
+ }
didChange = true;
- lastChange = iPos;
+ endMod = endStyled;
}
}
if (didChange) {
DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER,
- prevEndStyled, lastChange);
+ startMod, endMod - startMod + 1);
NotifyModified(mh);
}
enteredCount--;