summaryrefslogtreecommitdiff
path: root/src/macos/Sources/AppDelegate.swift
diff options
context:
space:
mode:
Diffstat (limited to 'src/macos/Sources/AppDelegate.swift')
-rw-r--r--src/macos/Sources/AppDelegate.swift18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/macos/Sources/AppDelegate.swift b/src/macos/Sources/AppDelegate.swift
index cbe9cdc9..3cce7592 100644
--- a/src/macos/Sources/AppDelegate.swift
+++ b/src/macos/Sources/AppDelegate.swift
@@ -310,6 +310,16 @@ final class AppDelegate: NSObject, NSApplicationDelegate, PardesViewDelegate {
file.addItem(withTitle: "Close Window",
action: #selector(NSWindow.performClose(_:)), keyEquivalent: "w")
+ // The workspace tag row's commands, in the place macOS keeps window
+ // commands. The build hands that row to this menu bar (see
+ // docs/macos.md): the words are the same builtins the tag carried,
+ // spelled exactly as a tag Exec would type them, and nothing here is
+ // editable — the menu is the tag's buttons, not the tag.
+ let builtins = submenu("Builtins", of: main)
+ for word in ["Newcol", "Joincol", "Find", "Grep", "Changelog",
+ "Dump", "NextColor", "Debug", "Kill"] {
+ builtins.addItem(command(word, #selector(menuBuiltin(_:)), ""))
+ }
let edit = submenu("Edit", of: main)
// Paste and nothing else. Copy, Cut, Undo and Select All have no
// builtin behind them — the core yanks into the clipboard on its own
@@ -379,13 +389,17 @@ final class AppDelegate: NSObject, NSApplicationDelegate, PardesViewDelegate {
// here would hide half of what Look does.
panel.canChooseDirectories = true
panel.allowsMultipleSelection = true
- panel.resolvesAliases = true
- guard panel.runModal() == .OK else { return }
for url in panel.urls where url.isFileURL {
look(url.path)
}
}
+ /// Any workspace-tag word. The title is the builtin's own spelling, so
+ /// this is the same `run` a tag Exec performs and there is no second
+ /// vocabulary to keep in step.
+ @objc private func menuBuiltin(_ sender: NSMenuItem) { run(sender.title) }
+
+
@objc private func menuNew(_ sender: Any?) { run("New") }
@objc private func menuSave(_ sender: Any?) { run("Save") }
@objc private func menuHelp(_ sender: Any?) { run("Help") }