From a74ff6bc032a82798486b4df9fab24703bff19da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Mon, 29 Mar 2021 14:55:35 +0900 Subject: [PATCH] Transaction: need to consume insert | delete properly. --- helix-core/src/transaction.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index aaf912dd9..7da5b7dda 100644 --- a/helix-core/src/transaction.rs +++ b/helix-core/src/transaction.rs @@ -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 {