2016-07-17 20:11:22 +03:00
|
|
|
/**
|
|
|
|
* Tae Won Ha - http://taewon.de - @hataewon
|
|
|
|
* See LICENSE
|
|
|
|
*/
|
|
|
|
|
|
|
|
import Cocoa
|
2017-06-15 19:03:25 +03:00
|
|
|
import Sparkle
|
2016-07-17 20:11:22 +03:00
|
|
|
|
2017-08-29 20:01:00 +03:00
|
|
|
let fileLog = LogContext.fileLogger(as: "VimR-file", with: URL(fileURLWithPath: "/tmp/vimr.log"))
|
|
|
|
let stdoutLog = LogContext.stdoutLogger(as: "VimR-stdout")
|
2017-06-06 14:47:23 +03:00
|
|
|
|
2016-07-17 20:11:22 +03:00
|
|
|
class Application: NSApplication {
|
|
|
|
|
|
|
|
override init() {
|
2017-06-15 00:45:33 +03:00
|
|
|
setPressAndHoldSetting()
|
2016-08-03 21:55:19 +03:00
|
|
|
super.init()
|
2016-07-17 20:11:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
required init?(coder: NSCoder) {
|
2017-06-15 00:45:33 +03:00
|
|
|
setPressAndHoldSetting()
|
|
|
|
super.init(coder: coder)
|
2016-07-17 20:11:22 +03:00
|
|
|
}
|
2016-08-26 10:19:40 +03:00
|
|
|
|
2016-09-25 19:29:42 +03:00
|
|
|
@IBAction override func showHelp(_: Any?) {
|
2016-09-25 18:50:33 +03:00
|
|
|
NSWorkspace.shared().open(URL(string: "https://github.com/qvacua/vimr/wiki")!)
|
2016-08-26 10:19:40 +03:00
|
|
|
}
|
2016-07-17 20:11:22 +03:00
|
|
|
}
|
2017-06-15 00:45:33 +03:00
|
|
|
|
|
|
|
fileprivate func setPressAndHoldSetting() {
|
|
|
|
// disable default press and hold behavior (copied from MacVim)
|
|
|
|
CFPreferencesSetAppValue(
|
|
|
|
"ApplePressAndHoldEnabled" as NSString,
|
|
|
|
"NO" as NSString,
|
|
|
|
kCFPreferencesCurrentApplication
|
|
|
|
)
|
|
|
|
}
|