diff options
author | nyamatongwe <unknown> | 2004-01-13 20:25:47 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2004-01-13 20:25:47 +0000 |
commit | b534149b1d3c3b1ef4f6e0dc836b0513dd5cd545 (patch) | |
tree | 4c520b693eedc7e27567552fecbd72bcc022a062 | |
parent | 60590dd936b2cbbdce7d620e1fa52a0e10ecfb9c (diff) | |
download | scintilla-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.
-rw-r--r-- | src/Document.cxx | 12 | ||||
-rw-r--r-- | src/Document.h | 1 | ||||
-rw-r--r-- | src/Editor.cxx | 1 |
3 files changed, 10 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) && diff --git a/src/Document.h b/src/Document.h index dc9e38e21..f5436ab4f 100644 --- a/src/Document.h +++ b/src/Document.h @@ -210,6 +210,7 @@ public: int GetEndStyled() { return endStyled; } bool EnsureStyledTo(int pos); int GetStyleClock() { return styleClock; } + void IncrementStyleClock(); int SetLineState(int line, int state) { return cb.SetLineState(line, state); } int GetLineState(int line) { return cb.GetLineState(line); } diff --git a/src/Editor.cxx b/src/Editor.cxx index c13398b31..f02ce2b6a 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3452,6 +3452,7 @@ void Editor::NotifyModified(Document*, DocModification mh, void *) { CheckForChangeOutsidePaint(Range(mh.position, mh.position + mh.length)); } if (mh.modificationType & SC_MOD_CHANGESTYLE) { + pdoc->IncrementStyleClock(); if (paintState == notPainting) { if (mh.position < pdoc->LineStart(topLine)) { // Styling performed before this view |