aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2010-09-24 13:14:40 +1000
committernyamatongwe <unknown>2010-09-24 13:14:40 +1000
commit7fb06ca08a70dd9f9549b1e34c7dd38e9ca1413a (patch)
treef16cf3c34093167f55e567d7a02edeef19675d19 /src/Editor.cxx
parent228fcb30c6b21ef2756a07a3eaf34f6371e80a39 (diff)
downloadscintilla-mirror-7fb06ca08a70dd9f9549b1e34c7dd38e9ca1413a.tar.gz
Added SCI_CONTRACTEDFOLDNEXT as a way to find contracted fold headers efficiently.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 762156c23..bca458037 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -6481,6 +6481,18 @@ void Editor::ToggleContraction(int line) {
}
}
+int Editor::ContractedFoldNext(int lineStart) {
+ for (int line = lineStart; line<pdoc->LinesTotal(); ) {
+ if (!cs.GetExpanded(line) && (pdoc->GetLevel(line) & SC_FOLDLEVELHEADERFLAG))
+ return line;
+ line = cs.ContractedNext(line+1);
+ if (line < 0)
+ return -1;
+ }
+
+ return -1;
+}
+
/**
* Recurse up from this line to find any folds that prevent this line from being visible
* and unfold them all.
@@ -7866,6 +7878,9 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
ToggleContraction(wParam);
break;
+ case SCI_CONTRACTEDFOLDNEXT:
+ return ContractedFoldNext(wParam);
+
case SCI_ENSUREVISIBLE:
EnsureLineVisible(wParam, false);
break;