From 119dee2980708f75150e39c19f92de029d92dad0 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Thu, 2 Dec 2021 23:49:54 +0900 Subject: fix: Correctly detect empty transactions Fixes #1221 --- helix-core/src/transaction.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'helix-core') diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index dfc18fbe..9c07be2c 100644 --- a/helix-core/src/transaction.rs +++ b/helix-core/src/transaction.rs @@ -330,7 +330,7 @@ impl ChangeSet { /// `true` when the set is empty. #[inline] pub fn is_empty(&self) -> bool { - self.changes.is_empty() + self.changes.is_empty() || self.changes == [Operation::Retain(self.len)] } /// Map a position through the changes. -- cgit v1.2.3-70-g09d2