diff --git a/crates/text_edit/src/lib.rs b/crates/text_edit/src/lib.rs index bc16778d34..21c622d3d6 100644 --- a/crates/text_edit/src/lib.rs +++ b/crates/text_edit/src/lib.rs @@ -123,7 +123,8 @@ impl TextEdit { self.indels.extend(other.indels); check_disjoint_and_sort(&mut self.indels); - self.indels.dedup(); + // Only dedup deletions and replacements, keep all insertions + self.indels.dedup_by(|a, b| a == b && !a.delete.is_empty()); Ok(()) }