From 7fb06ca08a70dd9f9549b1e34c7dd38e9ca1413a Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 24 Sep 2010 13:14:40 +1000 Subject: Added SCI_CONTRACTEDFOLDNEXT as a way to find contracted fold headers efficiently. --- src/Editor.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/Editor.cxx') 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; lineLinesTotal(); ) { + 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; -- cgit v1.2.3