1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-01 10:02:36 +03:00
vimr/VimR/Application.swift
2017-10-22 14:33:18 +02:00

37 lines
842 B
Swift

/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import Cocoa
import Sparkle
let fileLog = LogContext.fileLogger(as: "VimR-file", with: URL(fileURLWithPath: "/tmp/vimr.log"))
let stdoutLog = LogContext.stdoutLogger(as: "VimR-stdout")
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
)
}