diff options
author | Blaž Hrastnik | 2020-10-23 02:32:25 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2020-12-03 04:10:35 +0000 |
commit | c0e17dd324f016401d56d66b7c113dada0644155 (patch) | |
tree | a2d66d29cac70641af4811182b80e319426527f7 /helix-view/src/commands.rs | |
parent | b39849dde1b1277d14dbc4e2e1604e5d020db43d (diff) |
Fix undo/redo not updating the syntax tree.
Diffstat (limited to 'helix-view/src/commands.rs')
-rw-r--r-- | helix-view/src/commands.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/helix-view/src/commands.rs b/helix-view/src/commands.rs index b5350ff4..6bf89040 100644 --- a/helix-view/src/commands.rs +++ b/helix-view/src/commands.rs @@ -509,13 +509,17 @@ pub fn insert_char_prompt(prompt: &mut Prompt, c: char) { // Undo / Redo pub fn undo(view: &mut View, _count: usize) { - view.doc.history.undo(&mut view.doc.state); + if let Some(revert) = view.doc.history.undo() { + view.doc.apply(&revert); + } // TODO: each command could simply return a Option<transaction>, then the higher level handles storing it? } pub fn redo(view: &mut View, _count: usize) { - view.doc.history.redo(&mut view.doc.state); + if let Some(transaction) = view.doc.history.redo() { + view.doc.apply(&transaction); + } } // Yank / Paste |