documents: undo and redo leave a block only past its own history; typing lands after undo empties the document
CI / platforms (windows-latest) (push) Failing after 8s
CI / site (push) Successful in 21s
CI / crate (push) Failing after 11m46s
CI / platforms (ubuntu-24.04) (push) Canceled after 0s

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:28:33 -04:00
1 parent 362a0fc9fa
commit a3d9f089a3
5 files changed
+137 -87

No files matched your search

+3 -3
View File
@@ -164,15 +164,15 @@ impl Render for MarkdownDocument {
.on_action(cx.listener(|document, _: &Redo, window, cx| {
document.history(true, window, cx);
}))
// An untouched block leaves undo to the document.
// Past the block's own history, the document's.
.capture_action(cx.listener(|document, _: &forms::Undo, window, cx| {
if document.untouched(cx) {
if document.at_edge_of_history(false, cx) {
cx.stop_propagation();
document.history(false, window, cx);
}
}))
.capture_action(cx.listener(|document, _: &forms::Redo, window, cx| {
if document.untouched(cx) {
if document.at_edge_of_history(true, cx) {
cx.stop_propagation();
document.history(true, window, cx);
}