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

Catch <C-Tab> & <C-S-Tab>

This commit is contained in:
Ezequiel Rosas 2017-07-31 15:55:27 -05:00
parent 0138899e40
commit 69daf994de
2 changed files with 18 additions and 0 deletions

View File

@ -77,5 +77,6 @@ fileprivate let specialKeys = [
NSF33FunctionKey: "F33",
NSF34FunctionKey: "F34",
NSF35FunctionKey: "F35",
0x09: "Tab",
0x19: "Tab",
]

View File

@ -80,6 +80,23 @@ extension NeoVimView {
self.keyDownDone = false
}
override public func performKeyEquivalent(with event: NSEvent) -> Bool {
let type = event.type
let flags = event.modifierFlags
/* <C-Tab> & <C-S-Tab> do not trigger keyDown events.
Catch the key event here and pass it to keyDown.
(By rogual in NeoVim dot app
https://github.com/rogual/neovim-dot-app/pull/248/files )
*/
if .keyDown == type && flags.contains(.control) && 48 == event.keyCode {
self.keyDown(with: event)
return true
}
return false
}
public func setMarkedText(_ aString: Any, selectedRange: NSRange, replacementRange: NSRange) {
if self.markedText == nil {
self.markedPosition = self.grid.position