diff options
author | Michael Davis | 2022-10-12 15:57:40 +0000 |
---|---|---|
committer | GitHub | 2022-10-12 15:57:40 +0000 |
commit | e16c63276082f1cf79c57ff2ed2d301fe3333a0e (patch) | |
tree | 1b10135a4fe022c93e4c6c3d1438a94f6688c750 /helix-term | |
parent | 7f75458e6f29f2dc0717557a1072b70deee27acb (diff) |
Apply transactions to the jumplist for undo/redo (#4227)
Undo/redo/earlier/later call `Document::apply_impl` which applies
transactions to the document. These transactions also need to be
applied to the view as in 0aedef0.
Diffstat (limited to 'helix-term')
-rw-r--r-- | helix-term/src/commands.rs | 8 | ||||
-rw-r--r-- | helix-term/src/commands/typed.rs | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index dcaab222..93e82b84 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3258,7 +3258,7 @@ fn undo(cx: &mut Context) { let count = cx.count(); let (view, doc) = current!(cx.editor); for _ in 0..count { - if !doc.undo(view.id) { + if !doc.undo(view) { cx.editor.set_status("Already at oldest change"); break; } @@ -3269,7 +3269,7 @@ fn redo(cx: &mut Context) { let count = cx.count(); let (view, doc) = current!(cx.editor); for _ in 0..count { - if !doc.redo(view.id) { + if !doc.redo(view) { cx.editor.set_status("Already at newest change"); break; } @@ -3281,7 +3281,7 @@ fn earlier(cx: &mut Context) { let (view, doc) = current!(cx.editor); for _ in 0..count { // rather than doing in batch we do this so get error halfway - if !doc.earlier(view.id, UndoKind::Steps(1)) { + if !doc.earlier(view, UndoKind::Steps(1)) { cx.editor.set_status("Already at oldest change"); break; } @@ -3293,7 +3293,7 @@ fn later(cx: &mut Context) { let (view, doc) = current!(cx.editor); for _ in 0..count { // rather than doing in batch we do this so get error halfway - if !doc.later(view.id, UndoKind::Steps(1)) { + if !doc.later(view, UndoKind::Steps(1)) { cx.editor.set_status("Already at newest change"); break; } diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 726c7456..78d25c1a 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -483,7 +483,7 @@ fn earlier( let uk = args.join(" ").parse::<UndoKind>().map_err(|s| anyhow!(s))?; let (view, doc) = current!(cx.editor); - let success = doc.earlier(view.id, uk); + let success = doc.earlier(view, uk); if !success { cx.editor.set_status("Already at oldest change"); } @@ -502,7 +502,7 @@ fn later( let uk = args.join(" ").parse::<UndoKind>().map_err(|s| anyhow!(s))?; let (view, doc) = current!(cx.editor); - let success = doc.later(view.id, uk); + let success = doc.later(view, uk); if !success { cx.editor.set_status("Already at newest change"); } |