1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-25 06:43:24 +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.
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 {