Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

editor: Start transaction in replace impl (#3036)

Piotr Osiewicz8c47f117dbb9
diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs
index 568ea223cc1..504f12c5748 100644
--- a/crates/editor/src/items.rs
+++ b/crates/editor/src/items.rs
@@ -996,7 +996,9 @@ impl SearchableItem for Editor {
};
if let Some(replacement) = query.replacement_for(&text) {
- self.edit([(identifier.clone(), Arc::from(&*replacement))], cx);
+ self.transact(cx, |this, cx| {
+ this.edit([(identifier.clone(), Arc::from(&*replacement))], cx);
+ });
}
}
fn match_index_for_direction(