aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexCPP.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2001-08-06 13:58:16 +0000
committernyamatongwe <devnull@localhost>2001-08-06 13:58:16 +0000
commitf6e4242b3f8e56218180499b187755aa4d71feb7 (patch)
tree24bf3b9a3fb5a00f5de650339c60b30698f072d1 /src/LexCPP.cxx
parent0d38eb9d0878bbff56c43fb242c6e6e7af7ee0d7 (diff)
downloadscintilla-mirror-f6e4242b3f8e56218180499b187755aa4d71feb7.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;