editor: Start transaction in replace impl (#3036)

Piotr Osiewicz created

This fixes the undo with replace in project
/cc @maxbrunsfeld 

Release Notes:

- N/A

Change summary

crates/editor/src/items.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Detailed changes

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(