summaryrefslogtreecommitdiff
path: root/helix-view/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src/commands.rs')
-rw-r--r--helix-view/src/commands.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/helix-view/src/commands.rs b/helix-view/src/commands.rs
index 18135f0f..c92b33f5 100644
--- a/helix-view/src/commands.rs
+++ b/helix-view/src/commands.rs
@@ -417,3 +417,15 @@ pub fn delete_char_forward(view: &mut View, count: usize) {
transaction.apply(&mut view.state);
// TODO: need to store into history if successful
}
+
+// Undo / Redo
+
+pub fn undo(view: &mut View, _count: usize) {
+ view.history.undo(&mut view.state);
+
+ // TODO: each command should simply return a Option<transaction>, then the higher level handles storing it?
+}
+
+pub fn redo(view: &mut View, _count: usize) {
+ view.history.redo(&mut view.state);
+}