Correctly redo all undone edits after undoing in multi-buffer
When undoing edits performed in the multi-buffer, we also undo subsequent edits that may have occurred outside of the multi-buffer. This commit makes us redo those edits as well. Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
c5b0b5f902
commit
93eb005f74
2 changed files with 26 additions and 10 deletions
|
@ -84,6 +84,10 @@ pub struct Transaction {
|
|||
}
|
||||
|
||||
impl HistoryEntry {
|
||||
pub fn transaction_id(&self) -> TransactionId {
|
||||
self.transaction.id
|
||||
}
|
||||
|
||||
fn push_edit(&mut self, edit: &EditOperation) {
|
||||
self.transaction.edit_ids.push(edit.timestamp.local());
|
||||
self.transaction.end.observe(edit.timestamp.local());
|
||||
|
@ -1150,6 +1154,10 @@ impl Buffer {
|
|||
self.history.undo_stack.last()
|
||||
}
|
||||
|
||||
pub fn peek_redo_stack(&self) -> Option<&HistoryEntry> {
|
||||
self.history.redo_stack.last()
|
||||
}
|
||||
|
||||
pub fn start_transaction(&mut self) -> Option<TransactionId> {
|
||||
self.start_transaction_at(Instant::now())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue