aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexCPP.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2001-08-06 13:58:16 +0000
committernyamatongwe <unknown>2001-08-06 13:58:16 +0000
commitb7c65625c987a1ddcd6593ac33d7f73620acc6e1 (patch)
tree24bf3b9a3fb5a00f5de650339c60b30698f072d1 /src/LexCPP.cxx
parent5084ec75c65b408eead9bcc640d71e8e40f9a949 (diff)
downloadscintilla-mirror-b7c65625c987a1ddcd6593ac33d7f73620acc6e1.tar.gz
Fold column gets outlining style appearence.
Diffstat (limited to 'src/LexCPP.cxx')
-rw-r--r--src/LexCPP.cxx9
1 files changed, 7 insertions, 2 deletions
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;