aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMarko Njezic <devnull@localhost>2011-06-20 13:33:27 +0200
committerMarko Njezic <devnull@localhost>2011-06-20 13:33:27 +0200
commit85dc0204832948824579888601f33c7894b5dd50 (patch)
tree3d3a8db306f86e6cf0bfe2a61b533c93168920ff /src
parenta601fec1a7240dfd198a90e06312dd180ad2b0d9 (diff)
downloadscintilla-mirror-85dc0204832948824579888601f33c7894b5dd50.tar.gz
Properly highlight fold markers on sub lines. Bug #3323015.
This complements fold markers highlighting change from revision 3619, which only fixed part of the problem. Changes from revision 3620 have been reverted, as they cause line to be drawn out of bounds and overlap with previously drawn marker above. They are also no longer needed, with this change.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx15
-rw-r--r--src/LineMarker.cxx4
2 files changed, 11 insertions, 8 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index f618c78de..26c260101 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1930,18 +1930,23 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
if (marks) {
for (int markBit = 0; (markBit < 32) && marks; markBit++) {
if (marks & 1) {
- LineMarker::typeOfFold tFold;
+ LineMarker::typeOfFold tFold = LineMarker::undefined;
if (!highlightDelimiter.isCurrentBlockHighlight(lineDoc)) {
tFold = LineMarker::undefined;
} else if (highlightDelimiter.isBodyBlockFold(lineDoc)) {
tFold = LineMarker::body;
} else if (highlightDelimiter.isHeadBlockFold(lineDoc)) {
- tFold = LineMarker::head;
+ if (firstSubLine) {
+ tFold = LineMarker::head;
+ } else {
+ if (cs.GetExpanded(lineDoc)) {
+ tFold = LineMarker::body;
+ } else {
+ tFold = LineMarker::undefined;
+ }
+ }
} else if (highlightDelimiter.isTailBlockFold(lineDoc)) {
tFold = LineMarker::tail;
- } else {
- //Normally, this branch is never used. But I prefer to manage it anyway.
- tFold = LineMarker::undefined;
}
vs.markers[markBit].Draw(surface, rcMarker, vs.styles[STYLE_LINENUMBER].font, tFold);
}
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx
index 73410e2cd..747c5ff12 100644
--- a/src/LineMarker.cxx
+++ b/src/LineMarker.cxx
@@ -77,8 +77,6 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
case LineMarker::head :
head = backSelected;
tail = backSelected;
- if (markType == SC_MARK_VLINE)
- body = backSelected;
break;
case LineMarker::body :
head = backSelected;
@@ -186,7 +184,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
} else if (markType == SC_MARK_VLINE) {
surface->PenColour(body.allocated);
- surface->MoveTo(centreX, rcWhole.top + blobSize - (rcWhole.bottom - rcWhole.top)/2);
+ surface->MoveTo(centreX, rcWhole.top);
surface->LineTo(centreX, rcWhole.bottom);
} else if (markType == SC_MARK_LCORNER) {