aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/KeyWords.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2001-08-15 08:20:20 +0000
committernyamatongwe <devnull@localhost>2001-08-15 08:20:20 +0000
commit8837fdaaa2eaa0c61bf5d02e628b9b3f9a320ff0 (patch)
tree994b7aeabed12fe2b298c85a37047bbd1c748495 /src/KeyWords.cxx
parent43f0db3fba1641bfd5742880c9341df9097b02a2 (diff)
downloadscintilla-mirror-8837fdaaa2eaa0c61bf5d02e628b9b3f9a320ff0.tar.gz
Fixed up length to fold and initial style perturbed when making fold start
one line early.
Diffstat (limited to 'src/KeyWords.cxx')
-rw-r--r--src/KeyWords.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/KeyWords.cxx b/src/KeyWords.cxx
index d954a64e2..0728580fd 100644
--- a/src/KeyWords.cxx
+++ b/src/KeyWords.cxx
@@ -73,7 +73,13 @@ void LexerModule::Fold(unsigned int startPos, int lengthDoc, int initStyle,
// Move back one line in case deletion wrecked current line fold state
if (lineCurrent > 0) {
lineCurrent--;
- startPos = styler.LineStart(lineCurrent);
+ int newStartPos = styler.LineStart(lineCurrent);
+ lengthDoc += startPos - newStartPos;
+ startPos = newStartPos;
+ initStyle = 0;
+ if (startPos > 0) {
+ initStyle = styler.StyleAt(startPos - 1);
+ }
}
fnFolder(startPos, lengthDoc, initStyle, keywordlists, styler);
}