From e9bac5ccab179788ece77b0aefcc518d8eecca5d Mon Sep 17 00:00:00 2001 From: Zixuan Chen Date: Thu, 29 Feb 2024 20:36:45 +0800 Subject: [PATCH] fix: tracker insert err (#281) --- crates/loro-internal/src/container/richtext/tracker.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/loro-internal/src/container/richtext/tracker.rs b/crates/loro-internal/src/container/richtext/tracker.rs index 49a8f1ab..114a3de0 100644 --- a/crates/loro-internal/src/container/richtext/tracker.rs +++ b/crates/loro-internal/src/container/richtext/tracker.rs @@ -1,5 +1,5 @@ use generic_btree::{rle::Sliceable, LeafIndex}; -use loro_common::{Counter, HasId, HasIdSpan, IdFull, IdSpan, PeerID, ID}; +use loro_common::{Counter, HasId, HasIdSpan, IdFull, IdSpan, Lamport, PeerID, ID}; use rle::HasLength; use crate::VersionVector; @@ -100,6 +100,7 @@ impl Tracker { // the op is partially included, need to slice the content let start = (applied_counter_end - op_id.counter) as usize; + op_id.lamport += (applied_counter_end - op_id.counter) as Lamport; op_id.counter = applied_counter_end; pos += start; content = content.slice(start..);