diff options
author | nyamatongwe <devnull@localhost> | 2011-04-16 19:50:45 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2011-04-16 19:50:45 +1000 |
commit | 60a39b1f645752549bddc6b7026e6ff44ac95433 (patch) | |
tree | 15ad3a37676ce4bb532dbf9efb7f2a3c01cac55b /src/Document.cxx | |
parent | 884ae7980c1f6e8a749462c3ff1b7f2f2f4d0532 (diff) | |
download | scintilla-mirror-60a39b1f645752549bddc6b7026e6ff44ac95433.tar.gz |
Better highlight drawing where fold header has no subordinates. Bug #3279730.
From Jérôme LAFORGE.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index f74ac5830..b9b284e96 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -399,14 +399,15 @@ void Document::GetHighlightDelimiters(int line, HighlightDelimiter &highlightDel } } else if (!(lineLookLevel & SC_FOLDLEVELWHITEFLAG)) { endOfTailOfWhiteFlag = lineLook - 1; - if (lineLookLevel & SC_FOLDLEVELHEADERFLAG) { + levelNumber = lineLookLevel & SC_FOLDLEVELNUMBERMASK; + if (lineLookLevel & SC_FOLDLEVELHEADERFLAG && + //Managed the folding block when a fold header does not have any subordinate lines to fold away. + (levelNumber < (GetLevel(lineLook + 1) & SC_FOLDLEVELNUMBERMASK))) { beginFoldBlockFound = true; beginFoldBlock = lineLook; beginMarginCorrectlyDrawnZoneFound = true; beginMarginCorrectlyDrawnZone = endOfTailOfWhiteFlag; levelNumber = GetLevel(lineLook + 1) & SC_FOLDLEVELNUMBERMASK;; - } else { - levelNumber = lineLookLevel & SC_FOLDLEVELNUMBERMASK; } } } @@ -434,7 +435,9 @@ void Document::GetHighlightDelimiters(int line, HighlightDelimiter &highlightDel endFoldBlockFound = true; endFoldBlock = -1; } - if (!endMarginCorrectlyDrawnZoneFound && (lineLookLevel & SC_FOLDLEVELHEADERFLAG)) { + if (!endMarginCorrectlyDrawnZoneFound && (lineLookLevel & SC_FOLDLEVELHEADERFLAG) && + //Managed the folding block when a fold header does not have any subordinate lines to fold away. + (levelNumber < (GetLevel(lineLook + 1) & SC_FOLDLEVELNUMBERMASK))) { endMarginCorrectlyDrawnZoneFound = true; endMarginCorrectlyDrawnZone = lineLook; } |