Undo subsequent edits when undoing in multi-buffer
When undoing in the multi-buffer, don't preserve edits that occurred outside the multi-buffer after the edit being undone. Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
co-authored by
Antonio Scandurra
parent
d1f1563278
commit
9936bb2efa
@@ -560,7 +560,7 @@ impl MultiBuffer {
|
||||
for (buffer_id, buffer_transaction_id) in &transaction.buffer_transactions {
|
||||
if let Some(BufferState { buffer, .. }) = self.buffers.borrow().get(&buffer_id) {
|
||||
undone |= buffer.update(cx, |buf, cx| {
|
||||
buf.undo_transaction(*buffer_transaction_id, cx)
|
||||
buf.undo_to_transaction(*buffer_transaction_id, cx)
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -583,7 +583,7 @@ impl MultiBuffer {
|
||||
for (buffer_id, buffer_transaction_id) in &transaction.buffer_transactions {
|
||||
if let Some(BufferState { buffer, .. }) = self.buffers.borrow().get(&buffer_id) {
|
||||
redone |= buffer.update(cx, |buf, cx| {
|
||||
buf.redo_transaction(*buffer_transaction_id, cx)
|
||||
buf.redo_to_transaction(*buffer_transaction_id, cx)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user