aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-10-25 02:03:18 +0000
committerBlaž Hrastnik2021-10-25 02:09:09 +0000
commit3edca7854e66cbdb0c4baca25962a4f390fede55 (patch)
tree0cd0adda734fd3c02ec197b866ac2acaed2b1113 /helix-core/src
parentbfb6cff5a9b0ff5c37085086f895d3f14eaa5782 (diff)
completion: fully revert state before apply & insertText common prefix
Diffstat (limited to 'helix-core/src')
-rw-r--r--helix-core/src/transaction.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs
index 0e49fbe3..dfc18fbe 100644
--- a/helix-core/src/transaction.rs
+++ b/helix-core/src/transaction.rs
@@ -468,6 +468,13 @@ impl Transaction {
}
}
+ pub fn compose(mut self, other: Self) -> Self {
+ self.changes = self.changes.compose(other.changes);
+ // Other selection takes precedence
+ self.selection = other.selection;
+ self
+ }
+
pub fn with_selection(mut self, selection: Selection) -> Self {
self.selection = Some(selection);
self