Fix encoding of oplog snapshot (#168)

This commit is contained in:
Zixuan Chen 2023-11-12 20:39:00 +08:00 committed by GitHub
parent ce1077654a
commit 505ad4275b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -927,16 +927,16 @@ fn encode_oplog(oplog: &OpLog, state_ref: Option<PreEncodedState>) -> FinalPhase
loro_common::ContainerType::Tree => unreachable!(),
},
InnerListOp::InsertText {
slice,
slice: _,
unicode_len: len,
unicode_start: _,
unicode_start: start,
pos,
} => match op.container.get_type() {
loro_common::ContainerType::Text => {
encoded_ops.push(EncodedSnapshotOp::from(
SnapshotOp::RichtextInsert {
pos: *pos as usize,
start: slice.start(),
start: *start as usize,
len: *len as usize,
},
op.container.to_index(),