diff options
author | nyamatongwe <devnull@localhost> | 2001-08-07 08:12:59 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2001-08-07 08:12:59 +0000 |
commit | 9d868eab3b8afad86a0ef8b60aba732f066ab52c (patch) | |
tree | 8d94e778f06132eca64e3f845ea2d41e160b91a4 /src/Editor.cxx | |
parent | f6e4242b3f8e56218180499b187755aa4d71feb7 (diff) | |
download | scintilla-mirror-9d868eab3b8afad86a0ef8b60aba732f066ab52c.tar.gz |
Fixed up problem with outlining folding margin where folder tails were not
displayed if the display starts on a whitespace line.
Diffstat (limited to 'src/Editor.cxx')
-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; |