pub type TextDiffItem = DeltaItem<StringSlice, TextMeta>;Aliased Type§
pub enum TextDiffItem {
Retain {
len: usize,
attr: TextMeta,
},
Replace {
value: StringSlice,
attr: TextMeta,
delete: usize,
},
}Variants§
Retain
Replace
This is the combined of a delete and an insert.
They are two separate operations in the original Quill Delta format. But the order of two neighboring delete and insert operations can be swapped without changing the result. So Quill requires that the insert always comes before the delete. So it creates room for invalid deltas by the type system. Using Replace is a way to avoid this.