aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-04-27 12:44:42 +1000
committernyamatongwe <devnull@localhost>2011-04-27 12:44:42 +1000
commit2e7745b6130cd01c4a6bf886c3fd289cc564a60e (patch)
tree78a3a8e1105dff08fab09b71768a54d2c29bd219 /src/Editor.cxx
parent49bd97112a64526e3ce067c54d46440710189df8 (diff)
downloadscintilla-mirror-2e7745b6130cd01c4a6bf886c3fd289cc564a60e.tar.gz
Fold marker fixes for wrapped lines. Bug #3291579.
From Marko Njezic.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 2e8654ca4..05531a650 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1745,6 +1745,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
int lineDoc = cs.DocFromDisplay(visibleLine);
PLATFORM_ASSERT(cs.GetVisible(lineDoc));
bool firstSubLine = visibleLine == cs.DisplayFromDoc(lineDoc);
+ bool lastSubLine = visibleLine == (cs.DisplayFromDoc(lineDoc + 1) - 1);
// Decide which fold indicator should be displayed
level = pdoc->GetLevel(lineDoc);
@@ -1768,11 +1769,19 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
else
marks |= 1 << folderEnd;
}
- } else if (levelNum > SC_FOLDLEVELBASE){
+ } else if (levelNum > SC_FOLDLEVELBASE) {
marks |= 1 << SC_MARKNUM_FOLDERSUB;
}
} else {
- marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ if (levelNum < levelNextNum) {
+ if (cs.GetExpanded(lineDoc)) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
}
needWhiteClosure = false;
} else if (level & SC_FOLDLEVELWHITEFLAG) {
@@ -1803,10 +1812,14 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
if (levelNext & SC_FOLDLEVELWHITEFLAG) {
marks |= 1 << SC_MARKNUM_FOLDERSUB;
needWhiteClosure = true;
- } else if (levelNextNum > SC_FOLDLEVELBASE) {
- marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
+ } else if (lastSubLine) {
+ if (levelNextNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERTAIL;
+ }
} else {
- marks |= 1 << SC_MARKNUM_FOLDERTAIL;
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
}
} else {
marks |= 1 << SC_MARKNUM_FOLDERSUB;