From c041cb3a32ba6d66ecde5ef8d63687a02ff9fa89 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 10 Aug 2001 07:51:38 +0000 Subject: 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. --- src/KeyWords.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/KeyWords.cxx') 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 *[], -- cgit v1.2.3