1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-01 01:32:04 +03:00
vimr/SwiftNeoVim/NeoVimViewResponder.swift
Tae Won Ha 7358243b07
Add some support for marked text
- implement some of usual text-editing related selectors of NSResponder
- do not send <S-a> for A
- introduce a dispatch queue in XPC which is needed to sync all marked
  stuff
2016-06-29 18:18:11 +02:00

58 lines
1.4 KiB
Swift

/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import Cocoa
/// NeoVim's named keys can be found in keymap.c
extension NeoVimView {
public override func moveForward(sender: AnyObject?) {
self.xpc.vimInput(self.vimNamedKeys("Right"))
}
public override func moveRight(sender: AnyObject?) {
self.moveForward(sender)
}
public override func moveBackward(sender: AnyObject?) {
self.xpc.vimInput(self.vimNamedKeys("Left"))
}
public override func moveLeft(sender: AnyObject?) {
self.moveBackward(sender)
}
public override func moveUp(sender: AnyObject?) {
self.xpc.vimInput(self.vimNamedKeys("Up"))
}
public override func moveDown(sender: AnyObject?) {
self.xpc.vimInput(self.vimNamedKeys("Down"))
}
public override func deleteForward(sender: AnyObject?) {
self.xpc.vimInput(self.vimNamedKeys("DEL"))
}
public override func deleteBackward(sender: AnyObject?) {
self.xpc.vimInput(self.vimNamedKeys("BS"))
}
public override func scrollPageUp(sender: AnyObject?) {
self.xpc.vimInput(self.vimNamedKeys("PageUp"))
}
public override func scrollPageDown(sender: AnyObject?) {
self.xpc.vimInput(self.vimNamedKeys("PageDown"))
}
public override func scrollToBeginningOfDocument(sender: AnyObject?) {
self.xpc.vimInput(self.vimNamedKeys("Home"))
}
public override func scrollToEndOfDocument(sender: AnyObject?) {
self.xpc.vimInput(self.vimNamedKeys("End"))
}
}