1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-25 14:52:19 +03:00

Revert "Use user notification for init errors"

This reverts commit 2745bd9457.
This commit is contained in:
Tae Won Ha 2017-12-17 22:28:39 +01:00
parent 2745bd9457
commit bdabf83b38
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
2 changed files with 7 additions and 16 deletions

View File

@ -34,12 +34,6 @@ extension NvimView {
self.resizeNeoVimUi(to: self.bounds.size)
}
public func userNotificationCenter(_ center: NSUserNotificationCenter,
shouldPresent notification: NSUserNotification) -> Bool {
return true
}
func discreteSize(size: CGSize) -> Size {
return Size(width: Int(floor(size.width / self.cellSize.width)),
height: Int(floor(size.height / self.cellSize.height)))
@ -77,14 +71,12 @@ extension NvimView {
self.logger.fault("There was an error launching neovim.")
DispatchQueue.main.async {
let notification = NSUserNotification()
notification.identifier = self.uuid
notification.title = "Error during initialization"
notification.informativeText = "There was an error during the initialization of NeoVim. " +
let alert = NSAlert()
alert.alertStyle = .warning
alert.messageText = "Error during initialization"
alert.informativeText = "There was an error during the initialization of NeoVim. " +
"Use :messages to view the error messages."
NSUserNotificationCenter.default.delegate = self
NSUserNotificationCenter.default.deliver(notification)
alert.runModal()
}
}
}

View File

@ -10,8 +10,7 @@ import RxSwift
public class NvimView: NSView,
NvimUiBridgeProtocol,
NSUserInterfaceValidations,
NSTextInputClient,
NSUserNotificationCenterDelegate {
NSTextInputClient {
// MARK: - Public
public struct Config {