diff options
author | nyamatongwe <unknown> | 2002-07-28 13:17:34 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2002-07-28 13:17:34 +0000 |
commit | 1caaceed6e39ac16db40c4b39a89a6157ad55741 (patch) | |
tree | c483d8e4ce87a25fb014629d0aaa72688be18e51 /src/Document.cxx | |
parent | e8eaac5fedd8d48156154b0ee006b842196a85dd (diff) | |
download | scintilla-mirror-1caaceed6e39ac16db40c4b39a89a6157ad55741.tar.gz |
Changed styling notifications to only include the range up to the last
character that was actually modified.
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 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(); } |