Commit f18103132a
f18103132ab04144c6fafa0d2e50f7c201126344
parent: 34cbb80650
Verified · cmc
cmc <hello@cleberg.net> · 2026-10-08 03:29 UTC
Move Mac preset tags and deadline off system shortcuts
⌃⌘Q locks the screen and ⌃⌘D looks up a word. Set Tags is now ⌃⌘G
and Deadline ⌃⌘E.
Changed files (2)
Sources/OrgCore/Keymap/Presets.swift
+2 −2 · view
| @@ -1122,7 +1122,7 @@ public enum KeymapPreset: String, Sendable, CaseIterable { |
| 1122 | keys = "M-s-<up>" |
1122 | keys = "M-s-<up>" |
| 1123 | command = "org.heading.previous" |
1123 | command = "org.heading.previous" |
| 1124 | [[bind]] |
1124 | [[bind]] |
| 1125 | keys = "C-s-q" |
1125 | keys = "C-s-g" |
| 1126 | command = "org.tags.set" |
1126 | command = "org.tags.set" |
| 1127 | [[bind]] |
1127 | [[bind]] |
| 1128 | keys = "s-RET" |
1128 | keys = "s-RET" |
| @@ -1175,7 +1175,7 @@ public enum KeymapPreset: String, Sendable, CaseIterable { |
| 1175 | keys = "C-s-s" |
1175 | keys = "C-s-s" |
| 1176 | command = "org.schedule" |
1176 | command = "org.schedule" |
| 1177 | [[bind]] |
1177 | [[bind]] |
| 1178 | keys = "C-s-d" |
1178 | keys = "C-s-e" |
| 1179 | command = "org.deadline" |
1179 | command = "org.deadline" |
| 1180 | [[bind]] |
1180 | [[bind]] |
| 1181 | keys = "C-s-p" |
1181 | keys = "C-s-p" |
Tests/OrgCoreTests/KeymapTests.swift
+11 · view
| @@ -115,6 +115,17 @@ struct KeymapTests { |
| 115 | } |
115 | } |
| 116 | } |
116 | } |
| 117 | |
117 | |
| |
118 | /// ⌃⌘Q locks the screen, ⌃⌘D looks up a word, ⌃⌘F toggles full screen and ⌃⌘Space opens |
| |
119 | /// the character viewer: the app never sees them. |
| |
120 | @Test func macPresetAvoidsSystemShortcuts() { |
| |
121 | let reserved = ["q", "d", "f", "SPC"].map { KeyChord($0, [.control, .command]) } |
| |
122 | for binding in KeymapPreset.mac.keymap.bindings { |
| |
123 | #expect(!reserved.contains(binding.keys[0]), "\(KeySequence.format(binding.keys)) is \(binding.command)") |
| |
124 | } |
| |
125 | #expect(KeymapPreset.mac.keymap.keys(for: "org.tags.set") == [KeyChord("g", [.control, .command])]) |
| |
126 | #expect(KeymapPreset.mac.keymap.keys(for: "org.deadline") == [KeyChord("e", [.control, .command])]) |
| |
127 | } |
| |
128 | |
| 118 | @Test func shadowedBindingsShowNoKeys() throws { |
129 | @Test func shadowedBindingsShowNoKeys() throws { |
| 119 | var problems: [String] = [] |
130 | var problems: [String] = [] |
| 120 | let map = Keymap.layered([KeymapPreset.emacs.keymap, try Keymap(toml: "[[bind]]\nkeys = \"C-c C-t\"\ncommand = \"app.save\"\n", problems: &problems)]) |
131 | let map = Keymap.layered([KeymapPreset.emacs.keymap, try Keymap(toml: "[[bind]]\nkeys = \"C-c C-t\"\ncommand = \"app.save\"\n", problems: &problems)]) |