aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2004-01-13 20:25:47 +0000
committernyamatongwe <unknown>2004-01-13 20:25:47 +0000
commitb534149b1d3c3b1ef4f6e0dc836b0513dd5cd545 (patch)
tree4c520b693eedc7e27567552fecbd72bcc022a062 /src/Document.cxx
parent60590dd936b2cbbdce7d620e1fa52a0e10ecfb9c (diff)
downloadscintilla-mirror-b534149b1d3c3b1ef4f6e0dc836b0513dd5cd545.tar.gz
When styling is performed outside a styleneeded event,
increment the style clock so the layout cache is invalidated and so the styling is displayed.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r--src/Document.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index fb28144dd..9f5018c7e 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -1246,10 +1246,7 @@ bool Document::SetStyles(int length, char *styles) {
bool Document::EnsureStyledTo(int pos) {
if (pos > GetEndStyled()) {
- styleClock++;
- if (styleClock > 0x100000) {
- styleClock = 0;
- }
+ IncrementStyleClock();
// 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);
@@ -1258,6 +1255,13 @@ bool Document::EnsureStyledTo(int pos) {
return pos <= GetEndStyled();
}
+void Document::IncrementStyleClock() {
+ styleClock++;
+ if (styleClock > 0x100000) {
+ styleClock = 0;
+ }
+}
+
bool Document::AddWatcher(DocWatcher *watcher, void *userData) {
for (int i = 0; i < lenWatchers; i++) {
if ((watchers[i].watcher == watcher) &&