summaryrefslogtreecommitdiff
path: root/helix-core/src/history.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-14 01:04:03 +0000
committerBlaž Hrastnik2021-03-14 08:14:34 +0000
commit1cf887dea93f7aa2184772fa2073751f031c5bf3 (patch)
tree26756386efff7c8dd07c918a78a7a2c485816698 /helix-core/src/history.rs
parent3445abf88e550cce8ff5683f6fe45d7310597fd7 (diff)
Cleanup: use doc.selection() instead of doc.state.selection().
Diffstat (limited to 'helix-core/src/history.rs')
-rw-r--r--helix-core/src/history.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/helix-core/src/history.rs b/helix-core/src/history.rs
index 66445525..99de3f7c 100644
--- a/helix-core/src/history.rs
+++ b/helix-core/src/history.rs
@@ -101,7 +101,7 @@ mod test {
// Need to commit before applying!
history.commit_revision(&transaction1, &state);
transaction1.apply(&mut state);
- assert_eq!("hello world!", state.doc());
+ assert_eq!("hello world!", state.doc);
// ---
@@ -111,7 +111,7 @@ mod test {
// Need to commit before applying!
history.commit_revision(&transaction2, &state);
transaction2.apply(&mut state);
- assert_eq!("hello 世界!", state.doc());
+ assert_eq!("hello 世界!", state.doc);
// ---
fn undo(history: &mut History, state: &mut State) {
@@ -126,15 +126,15 @@ mod test {
}
undo(&mut history, &mut state);
- assert_eq!("hello world!", state.doc());
+ assert_eq!("hello world!", state.doc);
redo(&mut history, &mut state);
- assert_eq!("hello 世界!", state.doc());
+ assert_eq!("hello 世界!", state.doc);
undo(&mut history, &mut state);
undo(&mut history, &mut state);
- assert_eq!("hello", state.doc());
+ assert_eq!("hello", state.doc);
// undo at root is a no-op
undo(&mut history, &mut state);
- assert_eq!("hello", state.doc());
+ assert_eq!("hello", state.doc);
}
}