aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/SplitVector.h
diff options
context:
space:
mode:
authornyamatongwe <unknown>2007-07-27 01:52:48 +0000
committernyamatongwe <unknown>2007-07-27 01:52:48 +0000
commitf76d4f14632acb5eb5ff671d97654d4032cbef7e (patch)
tree6c226067ef20848c5c18189a68be8a75c20cd1c1 /src/SplitVector.h
parent50c550fbaa760461e3262ceaa2e0ab183f94ba21 (diff)
downloadscintilla-mirror-f76d4f14632acb5eb5ff671d97654d4032cbef7e.tar.gz
Changed lineStates to a SplitVector so that it supports insert and delete
so inserting and deleting lines does not cause a really large number of changed values under most circumstances leading to fewer notifications. SVector is no longer used.
Diffstat (limited to 'src/SplitVector.h')
-rw-r--r--src/SplitVector.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/SplitVector.h b/src/SplitVector.h
index 342be02ad..9d62aef72 100644
--- a/src/SplitVector.h
+++ b/src/SplitVector.h
@@ -181,6 +181,14 @@ public:
gapLength -= insertLength;
}
}
+
+ /// Ensure at least length elements allocated,
+ /// appending zero valued elements if needed.
+ void EnsureLength(int wantedLength) {
+ if (Length() < wantedLength) {
+ InsertValue(Length(), wantedLength - Length(), 0);
+ }
+ }
/// Insert text into the buffer from an array.
void InsertFromArray(int positionToInsert, const T s[], int positionFrom, int insertLength) {