Simplify undo_to_transaction and redo_to_transaction
We don't need to mutate the history anymore now that we render pending renames with a block decoration.
This commit is contained in:
@@ -1738,13 +1738,12 @@ impl Buffer {
|
||||
pub fn undo_to_transaction(
|
||||
&mut self,
|
||||
transaction_id: TransactionId,
|
||||
push_redo: bool,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> bool {
|
||||
let was_dirty = self.is_dirty();
|
||||
let old_version = self.version.clone();
|
||||
|
||||
let operations = self.text.undo_to_transaction(transaction_id, push_redo);
|
||||
let operations = self.text.undo_to_transaction(transaction_id);
|
||||
let undone = !operations.is_empty();
|
||||
for operation in operations {
|
||||
self.send_operation(Operation::Buffer(operation), cx);
|
||||
@@ -1771,13 +1770,12 @@ impl Buffer {
|
||||
pub fn redo_to_transaction(
|
||||
&mut self,
|
||||
transaction_id: TransactionId,
|
||||
push_undo: bool,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> bool {
|
||||
let was_dirty = self.is_dirty();
|
||||
let old_version = self.version.clone();
|
||||
|
||||
let operations = self.text.redo_to_transaction(transaction_id, push_undo);
|
||||
let operations = self.text.redo_to_transaction(transaction_id);
|
||||
let redone = !operations.is_empty();
|
||||
for operation in operations {
|
||||
self.send_operation(Operation::Buffer(operation), cx);
|
||||
|
||||
Reference in New Issue
Block a user