mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix crash with ¨ key (fix #1470)
This commit is contained in:
parent
8a7927d5dd
commit
fde75e89dc
@ -12,6 +12,7 @@ Change Log
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix an issue that the application crashed by typing the ¨ key with a Norwegian keyboard.
|
||||
- Fix an issue that the editor font did not applied to documents created via Services.
|
||||
|
||||
|
||||
|
@ -146,7 +146,10 @@ struct Shortcut {
|
||||
|
||||
assert(event.type == .keyDown)
|
||||
|
||||
guard let charactersIgnoringModifiers = event.charactersIgnoringModifiers else { return nil }
|
||||
guard
|
||||
let charactersIgnoringModifiers = event.charactersIgnoringModifiers,
|
||||
charactersIgnoringModifiers.count == 1
|
||||
else { return nil }
|
||||
|
||||
// correct Backspace and Forward Delete keys
|
||||
// -> Backspace: The key above the Return.
|
||||
@ -334,7 +337,7 @@ extension Shortcut: Equatable {
|
||||
let modifierMask = self.modifierMask.union(needsShift ? .shift : [])
|
||||
let keyEquivalent = self.keyEquivalent.lowercased()
|
||||
|
||||
return Shortcut(modifierMask: modifierMask, keyEquivalent: keyEquivalent)!
|
||||
return Shortcut(modifierMask: modifierMask, keyEquivalent: keyEquivalent) ?? self
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user