diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2011-04-16 10:31:38 +0000 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2011-04-16 10:31:38 +0000 |
commit | f3184f8ed9b54c016ccfb58ca674a8872da7ed05 (patch) | |
tree | f41ed8fa6cb2ed1d6a658ceb1d2870fc722588b0 /scintilla/src | |
parent | 19a47f7955117520cc2191a3ab17db86b863818d (diff) | |
download | notepad2-mod-f3184f8ed9b54c016ccfb58ca674a8872da7ed05.zip notepad2-mod-f3184f8ed9b54c016ccfb58ca674a8872da7ed05.tar.gz notepad2-mod-f3184f8ed9b54c016ccfb58ca674a8872da7ed05.tar.bz2 |
update scintilla
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@471 28bd50df-7adb-d945-0439-6e466c6a13cc
Diffstat (limited to 'scintilla/src')
-rw-r--r-- | scintilla/src/Document.cxx | 11 | ||||
-rw-r--r-- | scintilla/src/Document.h | 12 |
2 files changed, 13 insertions, 10 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;
}
diff --git a/scintilla/src/Document.h b/scintilla/src/Document.h index c25c0d5..2fe9020 100644 --- a/scintilla/src/Document.h +++ b/scintilla/src/Document.h @@ -130,7 +130,7 @@ public: }
bool isCurrentBlockHighlight(int line) {
- return isEnabled && beginFoldBlock <= line && line <= endFoldBlock;
+ return isEnabled && beginFoldBlock != -1 && beginFoldBlock <= line && line <= endFoldBlock;
}
bool isHeadBlockFold(int line) {
@@ -138,17 +138,17 @@ public: }
bool isBodyBlockFold(int line) {
- return beginFoldBlock < line && line < endFoldBlock;
+ return beginFoldBlock != -1 && beginFoldBlock < line && line < endFoldBlock;
}
bool isTailBlockFold(int line) {
- return beginFoldBlock < line && line == endFoldBlock;
+ return beginFoldBlock != -1 && beginFoldBlock < line && line == endFoldBlock;
}
// beginFoldBlock : Begin of current fold block.
- // endStartBlock : End of zone where margin is already drawn.
- // beginMarginCorrectlyDrawnZone : Begin of zone where margin is already drawn.
- // endMarginCorrectlyDrawnZone : End of current fold block.
+ // endStartBlock : End of current fold block.
+ // beginMarginCorrectlyDrawnZone : Begin of zone where margin is correctly drawn.
+ // endMarginCorrectlyDrawnZone : End of zone where margin is correctly drawn.
int beginFoldBlock;
int endFoldBlock;
int beginMarginCorrectlyDrawnZone;
|