aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ContractionState.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2010-09-24 13:14:40 +1000
committernyamatongwe <devnull@localhost>2010-09-24 13:14:40 +1000
commit27fe93c781719be46a2ca770f33f9cfba9cb054c (patch)
treecd28473d19ca2523fc24b6c430e65cbe037f7588 /src/ContractionState.cxx
parente612ffd2248bcacfc56bee45f277d110393c7171 (diff)
downloadscintilla-mirror-27fe93c781719be46a2ca770f33f9cfba9cb054c.tar.gz
Added SCI_CONTRACTEDFOLDNEXT as a way to find contracted fold headers efficiently.
Diffstat (limited to 'src/ContractionState.cxx')
-rw-r--r--src/ContractionState.cxx17
1 files changed, 17 insertions, 0 deletions
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;