Commit 5d313b882d

5d313b882d074ec238c7165acee91a0ae5e4a41a

parent: 520c19a5a0

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-05 04:38 UTC

Bind list keys

Layout: unified · split

Tests/OrgEditorAppKitTests/KeyTests.swift +19 · view
@@ -134,3 +134,22 @@ struct KeyTests {
134134 }
135135 }
136136}
137
138@MainActor
139struct ListKeyTests {
140 @Test func metaReturnInsertsAnItemInAListAndAHeadingElsewhere() {
141 let h = Harness("* a\n- x\n")
142 let event = { (flags: NSEvent.ModifierFlags) in
143 NSEvent.keyEvent(with: .keyDown, location: .zero, modifierFlags: flags, timestamp: 0, windowNumber: h.window.windowNumber,
144 context: nil, characters: "\r", charactersIgnoringModifiers: "\r", isARepeat: false, keyCode: 36)!
145 }
146 let meta = NSEvent.ModifierFlags(rawValue: NSEvent.ModifierFlags.option.rawValue | KeyEvents.leftOption)
147 h.caret(at: 7)
148 h.textView.keyDown(with: event(meta))
149 #expect(h.string == "* a\n- x\n- \n")
150 h.caret(at: 3)
151 h.textView.keyDown(with: event(meta))
152 #expect(h.string.hasPrefix("* a\n* \n"))
153 h.checkInSync()
154 }
155}
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form