aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorMichael Davis2022-11-27 16:46:42 +0000
committerBlaž Hrastnik2022-11-29 16:15:20 +0000
commit4d1f5389f99013be99b9498fd3fee78eec6217f3 (patch)
tree179f1d5835243f78567c32a221ea13634f692aa5 /helix-term/src
parentdf5457a6e71b58a39e198642efd7be0c4963153d (diff)
Revert "Don't apply transactions to Views in undo/redo"
This reverts commit fd00f3a70eb626242bb2fcc9bddf2c4d94580a9a.
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands.rs8
-rw-r--r--helix-term/src/commands/typed.rs4
2 files changed, 6 insertions, 6 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 5c6807f0..0817ca73 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -3321,7 +3321,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;
}
@@ -3332,7 +3332,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;
}
@@ -3344,7 +3344,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;
}
@@ -3356,7 +3356,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 351692fd..89c310fa 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -481,7 +481,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");
}
@@ -500,7 +500,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");
}