diff options
Diffstat (limited to 'scintilla/src/Document.cxx')
-rw-r--r-- | scintilla/src/Document.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scintilla/src/Document.cxx b/scintilla/src/Document.cxx index 15d1125..e230d2b 100644 --- a/scintilla/src/Document.cxx +++ b/scintilla/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;
}
|