From 8837fdaaa2eaa0c61bf5d02e628b9b3f9a320ff0 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 15 Aug 2001 08:20:20 +0000 Subject: Fixed up length to fold and initial style perturbed when making fold start one line early. --- src/KeyWords.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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); } -- cgit v1.2.3