mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-24 03:25:03 +03:00
36 lines
768 B
Swift
36 lines
768 B
Swift
/**
|
|
* Tae Won Ha - http://taewon.de - @hataewon
|
|
* See LICENSE
|
|
*/
|
|
|
|
import Cocoa
|
|
import Sparkle
|
|
|
|
let logger = FileLogger(as: "VimR", with: URL(fileURLWithPath: "/tmp/vimr.log"))
|
|
|
|
class Application: NSApplication {
|
|
|
|
override init() {
|
|
setPressAndHoldSetting()
|
|
super.init()
|
|
}
|
|
|
|
required init?(coder: NSCoder) {
|
|
setPressAndHoldSetting()
|
|
super.init(coder: coder)
|
|
}
|
|
|
|
@IBAction override func showHelp(_: Any?) {
|
|
NSWorkspace.shared().open(URL(string: "https://github.com/qvacua/vimr/wiki")!)
|
|
}
|
|
}
|
|
|
|
fileprivate func setPressAndHoldSetting() {
|
|
// disable default press and hold behavior (copied from MacVim)
|
|
CFPreferencesSetAppValue(
|
|
"ApplePressAndHoldEnabled" as NSString,
|
|
"NO" as NSString,
|
|
kCFPreferencesCurrentApplication
|
|
)
|
|
}
|