Transaction: need to consume insert | delete properly.

This commit is contained in:
Blaž Hrastnik 2021-03-29 14:55:35 +09:00
parent b52474cf66
commit a74ff6bc03

View File

@ -350,6 +350,8 @@ pub fn map_pos(&self, pos: usize, assoc: Assoc) -> usize {
// a subsequent delete means a replace, consume it
if let Some(Delete(len)) = iter.peek() {
iter.next();
old_end = old_pos + len;
// in range of replaced text
if old_end > pos {