Update crates/text_edit/src/lib.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
parent
83927e08a8
commit
e8416bb644
@ -123,7 +123,8 @@ pub fn union(&mut self, other: TextEdit) -> Result<(), 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(())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user