From 232ca90963dc11eefb061ac24756e96dc3030832 Mon Sep 17 00:00:00 2001 From: Alex Morson Date: Mon, 19 Jan 2026 21:03:51 +0000 Subject: [PATCH] Don't add no-op actions to the undo stack --- src/dusted/undo_stack.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dusted/undo_stack.py b/src/dusted/undo_stack.py index e1e9d44..393d82f 100644 --- a/src/dusted/undo_stack.py +++ b/src/dusted/undo_stack.py @@ -62,6 +62,9 @@ def execute(self, name: str) -> Generator[None, None, None]: yield after = self._snapshot() + if before == after: + return + del self._stack[self._index :] if self._unmodified_index > self._index: self._unmodified_index = -1