aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2000-03-16 11:43:39 +0000
committernyamatongwe <unknown>2000-03-16 11:43:39 +0000
commit35b3616d73451024b36279c4b8a05f19eeb17468 (patch)
tree3837357cf607234f40e4b4705c24da1e40ba0758 /src/Document.cxx
parent0e0ffc9c30980dd8f91b4b942407887841ee0235 (diff)
downloadscintilla-mirror-35b3616d73451024b36279c4b8a05f19eeb17468.tar.gz
Split up KeyWords.cxx into 7 individual lexer files Lex*.cxx.
Fixed setting up of second view to get right document length. Changed Python lexer to handle empty lines immediately after fold line and last line of document.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r--src/Document.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Document.cxx b/src/Document.cxx
index 8238ea758..b50b9691a 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -149,7 +149,10 @@ int Document::GetLastChild(int lineParent, int level) {
level = GetLevel(lineParent) & SC_FOLDLEVELNUMBERMASK;
int maxLine = LinesTotal();
int lineMaxSubord = lineParent;
- while ((lineMaxSubord < maxLine-1) && IsSubordinate(level, GetLevel(lineMaxSubord+1))) {
+ while (lineMaxSubord < maxLine-1) {
+ EnsureStyledTo(LineStart(lineMaxSubord+2));
+ if (!IsSubordinate(level, GetLevel(lineMaxSubord+1)))
+ break;
lineMaxSubord++;
}
if (lineMaxSubord > lineParent) {
@@ -696,6 +699,13 @@ void Document::SetStyles(int length, char *styles) {
}
}
+bool Document::EnsureStyledTo(int 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();
+}
+
bool Document::AddWatcher(DocWatcher *watcher, void *userData) {
for (int i = 0; i < lenWatchers; i++) {
if ((watchers[i].watcher == watcher) &&