diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2011-04-27 12:08:51 +0000 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2011-04-27 12:08:51 +0000 |
commit | 8674eb067d1791872f94720944b405943f38d91f (patch) | |
tree | 12c013643e4c45ecea5c2c5121da52785d05aeb8 /scintilla/src/Editor.cxx | |
parent | 7876d7699e3f321eaa392f69dfb685748938d214 (diff) | |
download | notepad2-mod-8674eb067d1791872f94720944b405943f38d91f.zip notepad2-mod-8674eb067d1791872f94720944b405943f38d91f.tar.gz notepad2-mod-8674eb067d1791872f94720944b405943f38d91f.tar.bz2 |
update scintilla
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@478 28bd50df-7adb-d945-0439-6e466c6a13cc
Diffstat (limited to 'scintilla/src/Editor.cxx')
-rw-r--r-- | scintilla/src/Editor.cxx | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx index e2d7d31..95fb7cf 100644 --- a/scintilla/src/Editor.cxx +++ b/scintilla/src/Editor.cxx @@ -1730,7 +1730,9 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { }
}
if (highlightDelimiter.isEnabled && (vs.ms[margin].mask & SC_MASK_FOLDERS)) {
- pdoc->GetHighlightDelimiters(pdoc->LineFromPosition(CurrentPosition()), highlightDelimiter);
+ int lineBack = cs.DocFromDisplay(topLine);
+ int lineFront = cs.DocFromDisplay(((rcMargin.bottom - rcMargin.top) / vs.lineHeight) + topLine) + 1;
+ pdoc->GetHighlightDelimiters(highlightDelimiter, pdoc->LineFromPosition(CurrentPosition()), lineBack, lineFront);
}
// Old code does not know about new markers needed to distinguish all cases
@@ -1745,6 +1747,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { int lineDoc = cs.DocFromDisplay(visibleLine);
PLATFORM_ASSERT(cs.GetVisible(lineDoc));
bool firstSubLine = visibleLine == cs.DisplayFromDoc(lineDoc);
+ bool lastSubLine = visibleLine == (cs.DisplayFromDoc(lineDoc + 1) - 1);
// Decide which fold indicator should be displayed
level = pdoc->GetLevel(lineDoc);
@@ -1768,11 +1771,19 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { else
marks |= 1 << folderEnd;
}
- } else if (levelNum > SC_FOLDLEVELBASE){
+ } else if (levelNum > SC_FOLDLEVELBASE) {
marks |= 1 << SC_MARKNUM_FOLDERSUB;
}
} else {
- marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ if (levelNum < levelNextNum) {
+ if (cs.GetExpanded(lineDoc)) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
+ } else if (levelNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
+ }
}
needWhiteClosure = false;
} else if (level & SC_FOLDLEVELWHITEFLAG) {
@@ -1803,10 +1814,14 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { if (levelNext & SC_FOLDLEVELWHITEFLAG) {
marks |= 1 << SC_MARKNUM_FOLDERSUB;
needWhiteClosure = true;
- } else if (levelNextNum > SC_FOLDLEVELBASE) {
- marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
+ } else if (lastSubLine) {
+ if (levelNextNum > SC_FOLDLEVELBASE) {
+ marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL;
+ } else {
+ marks |= 1 << SC_MARKNUM_FOLDERTAIL;
+ }
} else {
- marks |= 1 << SC_MARKNUM_FOLDERTAIL;
+ marks |= 1 << SC_MARKNUM_FOLDERSUB;
}
} else {
marks |= 1 << SC_MARKNUM_FOLDERSUB;
|