mirror of
https://github.com/qvacua/vimr.git
synced 2024-12-26 15:25:14 +03:00
Wait for some commands to avoid surviving swap files
This commit is contained in:
parent
4851005aac
commit
f5f398f7ae
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user