diff --git a/crates/loro-core/src/container/text/text_container.rs b/crates/loro-core/src/container/text/text_container.rs index 022701b7..4f481eef 100644 --- a/crates/loro-core/src/container/text/text_container.rs +++ b/crates/loro-core/src/container/text/text_container.rs @@ -186,7 +186,6 @@ impl Container for TextContainer { format!("{:?}", self.head).red(), format!("{:?}", latest_head).red(), ); - dbg!(&self.tracker); for effect in self.tracker.iter_effects(path.right) { debug_log!("EFFECT: {:?}", &effect); match effect { diff --git a/crates/loro-core/src/fuzz.rs b/crates/loro-core/src/fuzz.rs index 8350a2f2..c2a781da 100644 --- a/crates/loro-core/src/fuzz.rs +++ b/crates/loro-core/src/fuzz.rs @@ -318,20 +318,19 @@ mod test { 2, vec![ Ins { - content: "a".into(), - pos: 14072811359363267, + content: "12345".into(), + pos: 6447834, site: 0, }, - Sync { from: 186, to: 187 }, Ins { - content: "b".into(), - pos: 1374464008290728467, - site: 19, + content: "x".into(), + pos: 17753860855744831232, + site: 115, }, - Ins { - content: "c".into(), - pos: 3175903134871683258, - site: 186, + Del { + pos: 18335269204214833762, + len: 52354349510255359, + site: 0, }, ], ) diff --git a/crates/loro-core/src/macros.rs b/crates/loro-core/src/macros.rs index 7489e079..6faeba10 100644 --- a/crates/loro-core/src/macros.rs +++ b/crates/loro-core/src/macros.rs @@ -25,13 +25,13 @@ macro_rules! fx_map { macro_rules! debug_log { () => { if cfg!(test) { - $crate::print!("\n") + // $crate::print!("\n") } }; ($($arg:tt)*) => {{ if cfg!(test) { - print!("{}:{}\t", file!(), line!()); - println!($($arg)*); + // print!("{}:{}\t", file!(), line!()); + // println!($($arg)*); } }}; } diff --git a/crates/rle/src/rle_trait.rs b/crates/rle/src/rle_trait.rs index 088e7294..8d4e5901 100644 --- a/crates/rle/src/rle_trait.rs +++ b/crates/rle/src/rle_trait.rs @@ -107,8 +107,8 @@ impl> Sliceable for SmallVec { for item in self.iter() { if index < to && from < index + item.content_len() { let start = if index < from { from - index } else { 0 }; - let len = item.content_len().min(to - index); - ans.push(item.slice(start, from + len)); + let len = (item.content_len() - start).min(to - index); + ans.push(item.slice(start, start + len)); } index += item.content_len();