Commit Graph
6 Commits
Author SHA1 Message Date
aiongg aee3748be2 Merge #411: Undo: a command that runs another is one undo step
Conflict: crates/engine/src/guard.rs: next's snapshot tuple without revision (bump_revision on restore) + the PR's saved in_undo_step
2026-10-12 00:12:13 +00:00
noah1400 60f463f03c Undo: a caught panic leaves the outer command's undo step (#406)
After a panic the guard said that no undoable command is running. A
command that ran the one that panicked and carried on then had each
later command it ran record an undo step of its own. The guard now
puts that back to what it was when the command started.
2026-10-11 20:50:26 +02:00
aiongg f9985611bc Merge #411: Undo: a command that runs another is one undo step 2026-10-11 01:02:10 +00:00
noah1400andClaude Opus 5.5 ad173006f7 Undo: a command that runs another is one undo step (#406)
Cut, Duplicate, Paste in Place, the Arrange commands and pasting text
run a second command inside themselves, and both recorded an undo
step: the second Undo did nothing. Only the outer command records now.
A command that fails after changing the document records its step
too; a script that stopped at a bad step left changes that could not
be undone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 02:34:43 +02:00
aiongg 6dda095396 Engine: a cancelled gesture puts back the revision it began at
Cancelling a drag, a preview or an IME composition restores the
document, its selection and now its revision. Revisions come from one
counter, so the numbers a cancelled preview used are never handed out
again and caches keyed by (uid, revision) never show a cancelled
preview.
2026-10-10 16:05:46 +00:00
Brandon ThomasandClaude Opus 5.5 f1662185de Never crash: last-resort guard around every command
Session::execute runs each command inside catch_unwind: a panic that escapes
(any edit, import or export, from the UI, CLI, MCP or control channel)
becomes EngineError::Internal, the document and selection are restored to
before the command, and crash recovery is saved when enabled. The first
Session installs a panic hook that logs the message and location.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 12:55:07 -04:00