1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 03:25:03 +03:00

GH-302, GH-421 Write back to cli only when we can open the pipe

This commit is contained in:
Tae Won Ha 2017-06-12 20:17:09 +02:00
parent 5f88b0c37b
commit 9d38dd58e7
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -328,16 +328,20 @@ class MainWindow: NSObject,
extension MainWindow {
func neoVimStopped() {
if let cliPipePath = self.cliPipePath {
let fd = Darwin.open(cliPipePath, O_WRONLY)
let handle = FileHandle(fileDescriptor: fd)
handle.closeFile()
Darwin.close(fd)
}
self.isClosing = true
self.windowController.close()
self.emit(self.uuidAction(for: .close))
if let cliPipePath = self.cliPipePath {
let fd = Darwin.open(cliPipePath, O_WRONLY)
guard fd != -1 else {
return
}
let handle = FileHandle(fileDescriptor: fd)
handle.closeFile()
_ = Darwin.close(fd)
}
}
func set(title: String) {