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

On ocasions, NSTextInputContext comes as null.

This commit is contained in:
Ezequiel Rosas 2017-08-07 15:55:32 -05:00
parent 0138899e40
commit 101cf71718

View File

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