mirror of
https://github.com/loro-dev/loro.git
synced 2025-01-23 05:24:51 +00:00
fix: cursor should be invalidated
This commit is contained in:
parent
9407f52a1d
commit
65d6f4ffe9
1 changed files with 3 additions and 2 deletions
|
@ -96,14 +96,15 @@ impl<'a> Iterator for EffectIter<'a> {
|
||||||
id.counter,
|
id.counter,
|
||||||
id.counter + cursor.len as Counter,
|
id.counter + cursor.len as Counter,
|
||||||
);
|
);
|
||||||
|
// SAFETY: cursor is valid here
|
||||||
|
let content = unsafe { cursor.get_sliced().slice };
|
||||||
let changed = self
|
let changed = self
|
||||||
.tracker
|
.tracker
|
||||||
.update_cursors(smallvec![cursor], StatusChange::SetAsCurrent);
|
.update_cursors(smallvec![cursor], StatusChange::SetAsCurrent);
|
||||||
assert_eq!(changed as usize, span.len());
|
assert_eq!(changed as usize, span.len());
|
||||||
return Some(Effect::Ins {
|
return Some(Effect::Ins {
|
||||||
pos: index,
|
pos: index,
|
||||||
// SAFETY: cursor is valid
|
content,
|
||||||
content: unsafe { cursor.get_sliced().slice },
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
FirstCursorResult::Del(id, del) => {
|
FirstCursorResult::Del(id, del) => {
|
||||||
|
|
Loading…
Reference in a new issue