fix: cursor should be invalidated

This commit is contained in:
Zixuan Chen 2022-10-22 11:05:47 +08:00
parent 9407f52a1d
commit 65d6f4ffe9

View file

@ -96,14 +96,15 @@ impl<'a> Iterator for EffectIter<'a> {
id.counter,
id.counter + cursor.len as Counter,
);
// SAFETY: cursor is valid here
let content = unsafe { cursor.get_sliced().slice };
let changed = self
.tracker
.update_cursors(smallvec![cursor], StatusChange::SetAsCurrent);
assert_eq!(changed as usize, span.len());
return Some(Effect::Ins {
pos: index,
// SAFETY: cursor is valid
content: unsafe { cursor.get_sliced().slice },
content,
});
}
FirstCursorResult::Del(id, del) => {