1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-25 23:02:35 +03:00

Wait for some commands to avoid surviving swap files

This commit is contained in:
Tae Won Ha 2018-01-23 09:23:16 +01:00
parent 4851005aac
commit f5f398f7ae
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -179,27 +179,24 @@ extension NvimView {
/// Closes the current window. /// Closes the current window.
public func closeCurrentTab() { 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: true)
self.nvim.command(command: "q", expectsReturnValue: false)
} }
public func saveCurrentTab() { public func saveCurrentTab() {
self.nvim.command(command: "w", expectsReturnValue: false) self.nvim.command(command: "w", expectsReturnValue: true)
} }
public func saveCurrentTab(url: URL) { 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() { public func closeCurrentTabWithoutSaving() {
self.nvim.command(command: "q!", expectsReturnValue: false) self.nvim.command(command: "q!", expectsReturnValue: true)
} }
public func quitNeoVimWithoutSaving() { public func quitNeoVimWithoutSaving() {
self.nvim.command(command: "qa!", expectsReturnValue: false) self.bridgeLogger.mark()
self.eventsSubject.onNext(.neoVimStopped) self.nvim.command(command: "qa!", expectsReturnValue: true)
self.eventsSubject.onCompleted()
self.waitForNeoVimToQuit()
} }
public func vimOutput(of command: String) -> String { public func vimOutput(of command: String) -> String {