mirror of
https://github.com/loro-dev/loro.git
synced 2025-02-06 12:25:03 +00:00
fix: try to put origin right to an un deleted elem
This commit is contained in:
parent
7c032b6321
commit
0509db416b
1 changed files with 17 additions and 11 deletions
|
@ -104,18 +104,24 @@ impl ContentMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
let next = if prev.is_some() {
|
let next = if prev.is_some() {
|
||||||
let next_cursor = cursor.next_elem_start();
|
let mut next_cursor = cursor.next_elem_start();
|
||||||
if let Some(next_inner) = next_cursor {
|
let mut ans = None;
|
||||||
let mut cursor = next_inner.unwrap();
|
while let Some(next_inner) = next_cursor {
|
||||||
cursor.offset = 0;
|
if next_inner.as_ref().status.is_activated() {
|
||||||
cursor.pos = Position::Start;
|
let mut cursor = next_inner.unwrap();
|
||||||
Some(CursorWithId {
|
cursor.offset = 0;
|
||||||
id: next_inner.as_ref().id,
|
cursor.pos = Position::Start;
|
||||||
cursor,
|
ans = Some(CursorWithId {
|
||||||
})
|
id: next_inner.as_ref().id,
|
||||||
} else {
|
cursor,
|
||||||
None
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
next_cursor = next_inner.next_elem_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ans
|
||||||
} else {
|
} else {
|
||||||
// if prev is none, next should be the first element in the tree
|
// if prev is none, next should be the first element in the tree
|
||||||
let mut prev = cursor.prev_elem();
|
let mut prev = cursor.prev_elem();
|
||||||
|
|
Loading…
Reference in a new issue