macos: style changes, make equivalent not an optional

This commit is contained in:
Mitchell Hashimoto
2023-12-13 13:49:39 -08:00
parent 163ee1d75a
commit fefd4ca04d

View File

@ -838,16 +838,17 @@ extension Ghostty {
return false return false
} }
let equivalent: String? let equivalent: String
switch (event.charactersIgnoringModifiers) { switch (event.charactersIgnoringModifiers) {
case "/": case "/":
// Treat C-/ as C-_ // Treat C-/ as C-_. We do this because C-/ makes macOS make a beep
// sound and we don't like the beep sound.
equivalent = "_" equivalent = "_"
default:
equivalent = nil
}
guard let equivalent else { return false } default:
// Ignore other events
return false
}
let newEvent = NSEvent.keyEvent( let newEvent = NSEvent.keyEvent(
with: .keyDown, with: .keyDown,