mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-12-12 15:42:34 +00:00
17 lines
437 B
Rust
17 lines
437 B
Rust
|
|
use crate::{
|
||
|
|
client::view::DeleteExt,
|
||
|
|
core::{Attributes, Delta, DeltaBuilder, Interval},
|
||
|
|
};
|
||
|
|
|
||
|
|
pub struct DefaultDeleteExt {}
|
||
|
|
impl DeleteExt for DefaultDeleteExt {
|
||
|
|
fn apply(&self, _delta: &Delta, interval: Interval) -> Option<Delta> {
|
||
|
|
Some(
|
||
|
|
DeltaBuilder::new()
|
||
|
|
.retain(interval.start, Attributes::empty())
|
||
|
|
.delete(interval.size())
|
||
|
|
.build(),
|
||
|
|
)
|
||
|
|
}
|
||
|
|
}
|