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:
parent
5f88b0c37b
commit
9d38dd58e7
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user