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/ContractionState.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/ContractionState.cxx') diff --git a/src/ContractionState.cxx b/src/ContractionState.cxx index f2cc2f07b..8a1b486e7 100644 --- a/src/ContractionState.cxx +++ b/src/ContractionState.cxx @@ -193,6 +193,23 @@ bool ContractionState::SetExpanded(int lineDoc, bool expanded_) { } } +int ContractionState::ContractedNext(int lineDocStart) const { + if (OneToOne()) { + return -1; + } else { + Check(); + if (!expanded->ValueAt(lineDocStart)) { + return lineDocStart; + } else { + int lineDocNextChange = expanded->EndRun(lineDocStart); + if (lineDocNextChange < LinesInDoc()) + return lineDocNextChange; + else + return -1; + } + } +} + int ContractionState::GetHeight(int lineDoc) const { if (OneToOne()) { return 1; -- cgit v1.2.3