vim: Make each vim repeat its own transaction (#41735)

Release Notes:

- Pressing `u` after multiple `.` in rapid succession will now only undo
the latest repeat instead of all repeats.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
AidanV
2025-11-13 06:46:14 +00:00
committed by GitHub
co-authored by Conrad Irwin
parent 045ac6d1b6
commit 1fc0642de1
3 changed files with 44 additions and 1 deletions
+18 -1
View File
@@ -110,7 +110,24 @@ impl Replayer {
}
lock.running = true;
let this = self.clone();
window.defer(cx, move |window, cx| this.next(window, cx))
window.defer(cx, move |window, cx| {
this.next(window, cx);
let Some(Some(workspace)) = window.root::<Workspace>() else {
return;
};
let Some(editor) = workspace
.read(cx)
.active_item(cx)
.and_then(|item| item.act_as::<Editor>(cx))
else {
return;
};
editor.update(cx, |editor, cx| {
editor
.buffer()
.update(cx, |multi, cx| multi.finalize_last_transaction(cx))
});
})
}
pub fn stop(self) {