diff options
Diffstat (limited to 'helix-core/src/transaction.rs')
-rw-r--r-- | helix-core/src/transaction.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index 1f9e63aa..f25ee208 100644 --- a/helix-core/src/transaction.rs +++ b/helix-core/src/transaction.rs @@ -464,11 +464,13 @@ impl Transaction { I: IntoIterator<Item = Change> + ExactSizeIterator, { let len = doc.len_chars(); - let acc = Vec::with_capacity(2 * changes.len() + 1); + let acc = Vec::with_capacity(2 * changes.len() + 1); // rough estimate let mut changeset = ChangeSet { changes: acc, len }; // TODO: verify ranges are ordered and not overlapping or change will panic. + // TODO: test for (pos, pos, None) to factor out as nothing + let mut last = 0; for (from, to, tendril) in changes { // Retain from last "to" to current "from" |