This commit is contained in:
0x8664b2
2025-06-20 17:47:44 -07:00
parent 6df66ebbef
commit 9aea81e035
2 changed files with 18 additions and 1 deletions

View File

@@ -62,6 +62,20 @@ struct MarkdownViewerApp: App {
}
}
}
CommandGroup(replacing: .undoRedo) {
Button("Undo") {
print("Menu: Undo clicked, sending action to: \(NSApp.keyWindow?.firstResponder?.className ?? "nil")")
NSApp.sendAction(#selector(UndoManager.undo), to: nil, from: nil)
}
.keyboardShortcut("z", modifiers: .command)
Button("Redo") {
print("Menu: Redo clicked, sending action to: \(NSApp.keyWindow?.firstResponder?.className ?? "nil")")
NSApp.sendAction(#selector(UndoManager.redo), to: nil, from: nil)
}
.keyboardShortcut("z", modifiers: [.command, .shift])
}
}
}