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,17 +838,18 @@ extension Ghostty {
return false
}
let equivalent: String?
let equivalent: String
switch (event.charactersIgnoringModifiers) {
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 = "_"
default:
equivalent = nil
// Ignore other events
return false
}
guard let equivalent else { return false }
let newEvent = NSEvent.keyEvent(
with: .keyDown,
location: event.locationInWindow,