Fix out of bounds cursors in case of trailing delete
This commit is contained in:
parent
78525cef45
commit
7c081e8939
1 changed files with 7 additions and 1 deletions
|
|
@ -309,7 +309,13 @@ where
|
|||
|
||||
let last_index = merged_operations
|
||||
.iter()
|
||||
.last()
|
||||
.filter(|operation| {
|
||||
matches!(
|
||||
operation.operation,
|
||||
Operation::Insert { .. } | Operation::Equal { .. }
|
||||
)
|
||||
})
|
||||
.next_back()
|
||||
.map_or(0, |op| op.operation.end_index());
|
||||
|
||||
for cursor in left_cursors.chain(right_cursors) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue