1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-29 03:53:38 +03:00

Add becomeMain & resignMain methods

This commit is contained in:
Ezequiel Rosas 2017-07-27 21:40:02 -05:00
parent 0138899e40
commit eada6f95ba
2 changed files with 16 additions and 0 deletions

View File

@ -229,4 +229,12 @@ extension NeoVimView {
return nil
}
public func didBecomeMain() {
self.agent.vimInput("<FocusGained>")
}
public func didResignMain() {
self.agent.vimInput("<FocusLost>")
}
}

View File

@ -491,6 +491,14 @@ extension MainWindow {
self.emit(self.uuidAction(for: .becomeKey))
}
func windowDidBecomeMain(_ notification: Notification) {
self.neoVimView.didBecomeMain()
}
func windowDidResignMain(_ notification: Notification) {
self.neoVimView.didResignMain()
}
func windowShouldClose(_: Any) -> Bool {
guard self.neoVimView.isCurrentBufferDirty() else {
self.neoVimView.closeCurrentTab()