Undo WIP
This commit is contained in:
@@ -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])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user