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:
parent
0138899e40
commit
eada6f95ba
@ -229,4 +229,12 @@ extension NeoVimView {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
public func didBecomeMain() {
|
||||
self.agent.vimInput("<FocusGained>")
|
||||
}
|
||||
|
||||
public func didResignMain() {
|
||||
self.agent.vimInput("<FocusLost>")
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user