Allow redoing edits performed by inline assistant after cancelling it

This commit is contained in:
Antonio Scandurra 2023-08-28 14:42:41 +02:00
parent b9df85e01f
commit 52e1e014ad
4 changed files with 42 additions and 17 deletions

View file

@ -1668,14 +1668,14 @@ impl Buffer {
}
}
pub fn undo_and_forget(
pub fn undo_transaction(
&mut self,
transaction_id: TransactionId,
cx: &mut ModelContext<Self>,
) -> bool {
let was_dirty = self.is_dirty();
let old_version = self.version.clone();
if let Some(operation) = self.text.undo_and_forget(transaction_id) {
if let Some(operation) = self.text.undo_transaction(transaction_id) {
self.send_operation(Operation::Buffer(operation), cx);
self.did_edit(&old_version, was_dirty, cx);
true