aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/KeyWords.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2001-08-10 07:51:38 +0000
committernyamatongwe <unknown>2001-08-10 07:51:38 +0000
commit1a7a66dd32c4d0a74ec78a7ff48b71ecbfb90f50 (patch)
tree6a77531f3b80defd80fd8736d392155f10ec7be7 /src/KeyWords.cxx
parentcdfb090f2206c87a86dd5e55560ed853db39f983 (diff)
downloadscintilla-mirror-1a7a66dd32c4d0a74ec78a7ff48b71ecbfb90f50.tar.gz
Folding is started 1 line earlier than is being restyled to handle cases
where the deletion of a line end is leading to a bad fold state for that line.
Diffstat (limited to 'src/KeyWords.cxx')
-rw-r--r--src/KeyWords.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/KeyWords.cxx b/src/KeyWords.cxx
index 265dbf565..d954a64e2 100644
--- a/src/KeyWords.cxx
+++ b/src/KeyWords.cxx
@@ -68,8 +68,15 @@ void LexerModule::Lex(unsigned int startPos, int lengthDoc, int initStyle,
void LexerModule::Fold(unsigned int startPos, int lengthDoc, int initStyle,
WordList *keywordlists[], Accessor &styler) {
- if (fnFolder)
+ if (fnFolder) {
+ int lineCurrent = styler.GetLine(startPos);
+ // Move back one line in case deletion wrecked current line fold state
+ if (lineCurrent > 0) {
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
+ }
fnFolder(startPos, lengthDoc, initStyle, keywordlists, styler);
+ }
}
static void ColouriseNullDoc(unsigned int startPos, int length, int, WordList *[],