1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-29 16:56:40 +03:00
vimr/VimR/Application.swift
2017-06-20 13:39:17 +02:00

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
)
}