diff options
-rw-r--r-- | src/Editor.cxx | 18 | ||||
-rw-r--r-- | src/Editor.h | 1 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 5e31a165c..68089a5d9 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -666,6 +666,12 @@ void Editor::InvalidateCaret() { InvalidateRange(currentPos, currentPos + 1); } +int Editor::SubstituteMarkerIfEmpty(int markerCheck, int markerDefault) { + if (vs.markers[markerCheck].markType == SC_MARK_EMPTY) + return markerDefault; + return markerCheck; +} + void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { if (vs.fixedColumnWidth == 0) return ; @@ -730,7 +736,13 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { needWhiteClosure = true; } } - + + // Old code does not know about new markers needed to distinguish all cases + int folderOpenMid = SubstituteMarkerIfEmpty(SC_MARKNUM_FOLDEROPENMID, + SC_MARKNUM_FOLDEROPEN); + int folderEnd = SubstituteMarkerIfEmpty(SC_MARKNUM_FOLDEREND, + SC_MARKNUM_FOLDER); + while ((visibleLine < cs.LinesDisplayed()) && yposScreen < rcMargin.bottom) { // Decide which fold indicator should be displayed @@ -744,12 +756,12 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { if (levelNum == SC_FOLDLEVELBASE) marks |= 1 << SC_MARKNUM_FOLDEROPEN; else - marks |= 1 << SC_MARKNUM_FOLDEROPENMID; + marks |= 1 << folderOpenMid; } else { if (levelNum == SC_FOLDLEVELBASE) marks |= 1 << SC_MARKNUM_FOLDER; else - marks |= 1 << SC_MARKNUM_FOLDEREND; + marks |= 1 << folderEnd; } needWhiteClosure = false; } else if (level & SC_FOLDLEVELWHITEFLAG) { diff --git a/src/Editor.h b/src/Editor.h index 5f7531b47..0338467aa 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -213,6 +213,7 @@ protected: // ScintillaBase subclass needs access to much of Editor void DropCaret(); void InvalidateCaret(); + int SubstituteMarkerIfEmpty(int markerCheck, int markerDefault); void PaintSelMargin(Surface *surface, PRectangle &rc); void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout &ll); void DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVisible, int xStart, |