documents: undo and redo leave a block only past its own history; typing lands after undo empties the document
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
362a0fc9fa
commit
a3d9f089a3
5 files changed
+137
-87
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user