diff options
author | Blaž Hrastnik | 2020-09-13 14:38:54 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2020-09-13 14:40:11 +0000 |
commit | 96db02742e85648e4ce0c2ab9b7cd239bdb763f8 (patch) | |
tree | 92a08a66356cf7ced125be65add857904e7df11a /helix-core/src/transaction.rs | |
parent | 0427acd18cc06adec49783818107d1d5e2afc2ab (diff) |
Simplify some more code.
Diffstat (limited to 'helix-core/src/transaction.rs')
-rw-r--r-- | helix-core/src/transaction.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index 4ecc575a..b4cc83c6 100644 --- a/helix-core/src/transaction.rs +++ b/helix-core/src/transaction.rs @@ -3,13 +3,6 @@ use crate::{Rope, Selection, SelectionRange, State, Tendril}; /// (from, to, replacement) pub type Change = (usize, usize, Option<Tendril>); -// TODO: divided into three different operations, I sort of like having just -// Splice { extent, Option<text>, distance } better. -// insert: Splice { extent: 0, text: Some("a"), distance: 2 } -// delete: Splice { extent: 2, text: None, distance: 2 } -// replace: Splice { extent: 2, text: Some("abc"), distance: 2 } -// unchanged?: Splice { extent: 0, text: None, distance: 2 } -// harder to compose though. #[derive(Debug, Clone, PartialEq, Eq)] enum Operation { /// Move cursor by n characters. @@ -364,7 +357,6 @@ impl Transaction { let mut last = 0; for (from, to, tendril) in changes { - // TODO: need to fill the in-between ranges too // Retain from last "to" to current "from" acc.push(Operation::Retain(from - last)); match tendril { @@ -383,7 +375,7 @@ impl Transaction { where F: Fn(&SelectionRange) -> Change, { - Self::change(state, state.selection.ranges.iter().map(f)) + Self::change(state, state.selection.ranges().iter().map(f)) } /// Insert text at each selection head. |