From 8c47f117dbb9485413939c2ba57d76b484a9051b Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Tue, 26 Sep 2023 19:21:15 +0200 Subject: [PATCH] editor: Start transaction in replace impl (#3036) This fixes the undo with replace in project /cc @maxbrunsfeld Release Notes: - N/A --- crates/editor/src/items.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 568ea223cc10e7037414e5ca4b18d15f18779830..504f12c57482b34267b202d6a0017b34ea3bf83a 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(