From b7c65625c987a1ddcd6593ac33d7f73620acc6e1 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 6 Aug 2001 13:58:16 +0000 Subject: Fold column gets outlining style appearence. --- src/LexCPP.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/LexCPP.cxx') diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index 512581807..c5e55df8b 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -332,15 +332,20 @@ static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordLis Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment"); bool foldCompact = styler.GetPropertyInt("fold.compact", 1); - unsigned int lengthDoc = startPos + length; + unsigned int endPos = startPos + length; int visibleChars = 0; 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); + } int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; - for (unsigned int i = startPos; i < lengthDoc; i++) { + for (unsigned int i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; -- cgit v1.2.3