1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-25 06:06:21 +03:00

Merge pull request #505 from nhtzr/fix-ctx-crash

On ocasions, NSTextInputContext comes as null.
This commit is contained in:
Tae Won Ha 2017-08-08 17:56:48 +02:00 committed by GitHub
commit 254b813a2f

View File

@ -10,8 +10,8 @@ extension NeoVimView {
override public func keyDown(with event: NSEvent) {
self.keyDownDone = false
let context = NSTextInputContext.current()!
let cocoaHandledEvent = context.handleEvent(event)
let context = NSTextInputContext.current()
let cocoaHandledEvent = context?.handleEvent(event) ?? false
if self.keyDownDone && cocoaHandledEvent {
return
}