documents: one undo history; a block's own never runs
CI / platforms (windows-latest) (push) Failing after 8s
CI / site (push) Successful in 22s
CI / crate (push) Failing after 11m33s
CI / platforms (ubuntu-24.04) (push) Canceled after 0s

Undo or redo in an open block writes it back as one step and steps the
document, so redo survives mode switches and further undos.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-12 04:39:09 -04:00
1 parent a3d9f089a3
commit 639521e109
4 files changed
+35 -39

No files matched your search

+5 -9
View File
@@ -164,18 +164,14 @@ impl Render for MarkdownDocument {
.on_action(cx.listener(|document, _: &Redo, window, cx| {
document.history(true, window, cx);
}))
// Past the block's own history, the document's.
// One history: a block's own never runs.
.capture_action(cx.listener(|document, _: &forms::Undo, window, cx| {
if document.at_edge_of_history(false, cx) {
cx.stop_propagation();
document.history(false, window, cx);
}
cx.stop_propagation();
document.history(false, window, cx);
}))
.capture_action(cx.listener(|document, _: &forms::Redo, window, cx| {
if document.at_edge_of_history(true, cx) {
cx.stop_propagation();
document.history(true, window, cx);
}
cx.stop_propagation();
document.history(true, window, cx);
}))
.capture_action(cx.listener(|document, _: &Up, window, cx| {
if document.step(false, window, cx) {