diff options
author | nyamatongwe <unknown> | 2001-08-07 08:12:59 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2001-08-07 08:12:59 +0000 |
commit | 853feea7bd73ef8307ebd33e5bdb551485231688 (patch) | |
tree | 8d94e778f06132eca64e3f845ea2d41e160b91a4 | |
parent | b7c65625c987a1ddcd6593ac33d7f73620acc6e1 (diff) | |
download | scintilla-mirror-853feea7bd73ef8307ebd33e5bdb551485231688.tar.gz |
Fixed up problem with outlining folding margin where folder tails were not
displayed if the display starts on a whitespace line.
-rw-r--r-- | src/Editor.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 436b20795..5e31a165c 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -712,21 +712,28 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { int visibleLine = topLine; int line = cs.DocFromDisplay(visibleLine); int yposScreen = 0; - bool needWhiteClosure = false; + + // Work out whether the top line is whitespace located after a + // lessening of fold level which implies a 'fold tail' but which should not + // be displayed until the last of a sequence of whitespace. + bool needWhiteClosure = false; int level = pdoc->GetLevel(line); if (level & SC_FOLDLEVELWHITEFLAG) { - int lineBack = line-1; - while ((lineBack > 0) && (level & SC_FOLDLEVELWHITEFLAG)) { + int lineBack = line; + int levelPrev = level; + while ((lineBack > 0) && (levelPrev & SC_FOLDLEVELWHITEFLAG)) { lineBack--; - level = pdoc->GetLevel(lineBack); + levelPrev = pdoc->GetLevel(lineBack); } - if (!(level & SC_FOLDLEVELHEADERFLAG) && (lineBack > 0)) { - int levelPrev = pdoc->GetLevel(lineBack-1); + if (!(levelPrev & SC_FOLDLEVELHEADERFLAG)) { if ((level & SC_FOLDLEVELNUMBERMASK) < (levelPrev & SC_FOLDLEVELNUMBERMASK)) needWhiteClosure = true; } } + while ((visibleLine < cs.LinesDisplayed()) && yposScreen < rcMargin.bottom) { + + // Decide which fold indicator should be displayed level = pdoc->GetLevel(line); int levelNext = pdoc->GetLevel(line+1); int marks = pdoc->GetMark(line); @@ -772,6 +779,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { marks |= 1 << SC_MARKNUM_FOLDERSUB; } } + marks &= vs.ms[margin].mask; PRectangle rcMarker = rcSelMargin; rcMarker.top = yposScreen; |