1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-29 16:56:40 +03:00

GH-512 Quit the agent when VIMLEAVE event is fired

This commit is contained in:
Tae Won Ha 2017-08-23 08:08:23 +02:00
parent 65cec4e1fb
commit 0c20cebfe6
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -187,14 +187,13 @@ extension NeoVimView {
self.quitNeoVimCondition.unlock() self.quitNeoVimCondition.unlock()
gui.async { gui.async {
self.agent.quit()
self.delegate?.neoVimStopped() self.delegate?.neoVimStopped()
} }
} }
public func autoCommandEvent(_ event: NeoVimAutoCommandEvent, bufferHandle: Int) { public func autoCommandEvent(_ event: NeoVimAutoCommandEvent, bufferHandle: Int) {
gui.async { gui.async {
// self.bridgeLogger.debug("\(neoVimAutoCommandEventName(event)) -> \(bufferHandle)") self.bridgeLogger.debug("\(neoVimAutoCommandEventName(event)) -> \(bufferHandle)")
if event == .BUFWINENTER || event == .BUFWINLEAVE { if event == .BUFWINENTER || event == .BUFWINLEAVE {
self.bufferListChanged() self.bufferListChanged()
@ -207,6 +206,10 @@ extension NeoVimView {
if event == .BUFREADPOST || event == .BUFWRITEPOST { if event == .BUFREADPOST || event == .BUFWRITEPOST {
self.currentBufferChanged(bufferHandle) self.currentBufferChanged(bufferHandle)
} }
if event == .VIMLEAVE {
self.agent.quit()
}
} }
} }