From 119dee2980708f75150e39c19f92de029d92dad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Thu, 2 Dec 2021 23:49:54 +0900 Subject: [PATCH] fix: Correctly detect empty transactions Fixes #1221 --- helix-core/src/transaction.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs index dfc18fbea..9c07be2c8 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.