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