aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2002-07-28 13:17:34 +0000
committernyamatongwe <devnull@localhost>2002-07-28 13:17:34 +0000
commitb6318a8f9cad997cccc2c09fd4d66a4413408228 (patch)
treec483d8e4ce87a25fb014629d0aaa72688be18e51 /src
parent02a753124ae352dc7a3237689a108b9fd4bf7d28 (diff)
downloadscintilla-mirror-b6318a8f9cad997cccc2c09fd4d66a4413408228.tar.gz
Changed styling notifications to only include the range up to the last
character that was actually modified.
Diffstat (limited to 'src')
-rw-r--r--src/Document.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 97ca97adc..745812044 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -1111,15 +1111,17 @@ bool Document::SetStyles(int length, char *styles) {
enteredCount++;
int prevEndStyled = endStyled;
bool didChange = false;
+ int lastChange = 0;
for (int iPos = 0; iPos < length; iPos++, endStyled++) {
PLATFORM_ASSERT(endStyled < Length());
if (cb.SetStyleAt(endStyled, styles[iPos], stylingMask)) {
didChange = true;
+ lastChange = iPos;
}
}
if (didChange) {
DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER,
- prevEndStyled, endStyled - prevEndStyled);
+ prevEndStyled, lastChange);
NotifyModified(mh);
}
enteredCount--;
@@ -1133,10 +1135,11 @@ bool Document::EnsureStyledTo(int pos) {
if (styleClock > 0x100000) {
styleClock = 0;
}
+ // Ask the watchers to style, and stop as soon as one responds.
+ for (int i = 0; pos > GetEndStyled() && i < lenWatchers; i++) {
+ watchers[i].watcher->NotifyStyleNeeded(this, watchers[i].userData, pos);
+ }
}
- // Ask the watchers to style, and stop as soon as one responds.
- for (int i = 0; pos > GetEndStyled() && i < lenWatchers; i++)
- watchers[i].watcher->NotifyStyleNeeded(this, watchers[i].userData, pos);
return pos <= GetEndStyled();
}