diff options
author | nyamatongwe <devnull@localhost> | 2000-03-16 11:43:39 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2000-03-16 11:43:39 +0000 |
commit | 01cd695dc8d693c39500f24adf689d08d77d39da (patch) | |
tree | 3837357cf607234f40e4b4705c24da1e40ba0758 /src/Document.cxx | |
parent | 8c214e65f503275192e2f3f9dea97fbb65a38254 (diff) | |
download | scintilla-mirror-01cd695dc8d693c39500f24adf689d08d77d39da.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.cxx | 12 |
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) && |