diff options
author | Nathan Vegdahl | 2021-07-02 02:37:28 +0000 |
---|---|---|
committer | Nathan Vegdahl | 2021-07-02 02:37:28 +0000 |
commit | 2224a1527ec9592f16131b0aa3923fc3d37592e7 (patch) | |
tree | 2a08b053cb32cef9dc1db5895778d419ebaebb5b /helix-core/src/history.rs | |
parent | e725957704274b1ec814a34ddf6f75faf35358e7 (diff) | |
parent | 9f62ad0715240156b512dfc7c584d2d0df05a664 (diff) |
Merge branch 'master' into great_line_ending_and_cursor_range_cleanup
Diffstat (limited to 'helix-core/src/history.rs')
-rw-r--r-- | helix-core/src/history.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/helix-core/src/history.rs b/helix-core/src/history.rs index 23680275..67ded166 100644 --- a/helix-core/src/history.rs +++ b/helix-core/src/history.rs @@ -1,7 +1,6 @@ use crate::{ChangeSet, Rope, State, Transaction}; use once_cell::sync::Lazy; use regex::Regex; -use smallvec::{smallvec, SmallVec}; use std::num::NonZeroUsize; use std::time::{Duration, Instant}; @@ -127,7 +126,6 @@ impl History { let last_child = current_revision.last_child?; self.current = last_child.get(); - let last_child_revision = &self.revisions[last_child.get()]; Some(&self.revisions[last_child.get()].transaction) } @@ -377,21 +375,21 @@ mod test { if let Some(transaction) = history.undo() { transaction.apply(&mut state.doc); } - }; + } fn earlier(history: &mut History, state: &mut State, uk: UndoKind) { let txns = history.earlier(uk); for txn in txns { txn.apply(&mut state.doc); } - }; + } fn later(history: &mut History, state: &mut State, uk: UndoKind) { let txns = history.later(uk); for txn in txns { txn.apply(&mut state.doc); } - }; + } fn commit_change( history: &mut History, @@ -402,7 +400,7 @@ mod test { let txn = Transaction::change(&state.doc, vec![change.clone()].into_iter()); history.commit_revision_at_timestamp(&txn, &state, instant); txn.apply(&mut state.doc); - }; + } let t0 = Instant::now(); let t = |n| t0.checked_add(Duration::from_secs(n)).unwrap(); |