Make paste a separate undo transaction from preceding edits (#52003)

When undoing a paste, it is really confusing when that actually also
removes what was type right before the paste if the paste happened fast
enough after.

Release Notes:

- Fixed undoing a paste sometimes also undoing edits right before the
paste
This commit is contained in:
Lukas Wirth authored and GitHub committed 2026-03-30 07:17:02 +00:00
1 parent f746bbff0c
commit 6d33fa6b71
6 files changed
+55 -15

No files matched your search

+8 -1
View File
@@ -1234,8 +1234,15 @@ impl MultiBuffer {
}
}
pub fn set_group_interval(&mut self, group_interval: Duration) {
pub fn set_group_interval(&mut self, group_interval: Duration, cx: &mut Context<Self>) {
self.history.set_group_interval(group_interval);
if self.singleton {
for BufferState { buffer, .. } in self.buffers.values() {
buffer.update(cx, |buffer, _| {
buffer.set_group_interval(group_interval);
});
}
}
}
pub fn with_title(mut self, title: String) -> Self {