fix: avoid zero len del in text

This commit is contained in:
Zixuan Chen 2023-03-31 10:58:07 +08:00
parent 63cd719393
commit b8056614f5

View file

@ -79,6 +79,10 @@ impl TextContainer {
}
pub(crate) fn delete(&mut self, txn: &mut Transaction, pos: usize, len: usize) {
if len == 0 {
return;
}
self.state.delete_range(Some(pos), Some(pos + len));
txn.with_store_hierarchy_mut(|txn, store, hierarchy| {
let id = store.next_id();