mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-25 06:06:21 +03:00
Merge pull request #494 from nhtzr/add-fgevent
Add becomeMain & resignMain methods
This commit is contained in:
commit
eb406668a2
@ -247,4 +247,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