From f5f398f7aeccfe19e75e572b68bf0c7d2052d2de Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Tue, 23 Jan 2018 09:23:16 +0100 Subject: [PATCH] Wait for some commands to avoid surviving swap files --- NvimView/NvimView/NvimView+Api.swift | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/NvimView/NvimView/NvimView+Api.swift b/NvimView/NvimView/NvimView+Api.swift index b87c7992..ce2da5c2 100644 --- a/NvimView/NvimView/NvimView+Api.swift +++ b/NvimView/NvimView/NvimView+Api.swift @@ -179,27 +179,24 @@ extension NvimView { /// Closes the current window. public func closeCurrentTab() { - // We don't have to wait here even when neovim quits since we wait in gui.async() block in neoVimStopped(). - self.nvim.command(command: "q", expectsReturnValue: false) + self.nvim.command(command: "q", expectsReturnValue: true) } public func saveCurrentTab() { - self.nvim.command(command: "w", expectsReturnValue: false) + self.nvim.command(command: "w", expectsReturnValue: true) } public func saveCurrentTab(url: URL) { - self.nvim.command(command: "w \(url.path)", expectsReturnValue: false) + self.nvim.command(command: "w \(url.path)", expectsReturnValue: true) } public func closeCurrentTabWithoutSaving() { - self.nvim.command(command: "q!", expectsReturnValue: false) + self.nvim.command(command: "q!", expectsReturnValue: true) } public func quitNeoVimWithoutSaving() { - self.nvim.command(command: "qa!", expectsReturnValue: false) - self.eventsSubject.onNext(.neoVimStopped) - self.eventsSubject.onCompleted() - self.waitForNeoVimToQuit() + self.bridgeLogger.mark() + self.nvim.command(command: "qa!", expectsReturnValue: true) } public func vimOutput(of command: String) -> String {