diff options
author | nyamatongwe <unknown> | 2005-09-10 00:40:26 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2005-09-10 00:40:26 +0000 |
commit | a110498be71cc77ffe566c1dff1e5c33516cfbfe (patch) | |
tree | ad2001d7fff870d89f5218303916b2a15226b6ff /src/Document.cxx | |
parent | 68276604baeb6a9a3c6cf6b17d02fd68af69c7e8 (diff) | |
download | scintilla-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.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 11 |
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--; |