1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-28 02:54:31 +03:00
This commit is contained in:
Tae Won Ha 2020-01-18 16:33:42 +01:00
parent f0c329efc3
commit 02d6ef4ced
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -91,14 +91,15 @@ class OpenQuicklyWindow: NSObject,
private func subscription(_ state: StateType) { private func subscription(_ state: StateType) {
self.updateRootUrls(state: state) self.updateRootUrls(state: state)
guard state.openQuickly.open, guard state.openQuickly.open, let curWinState = state.currentMainWindow else {
let curWinState = state.currentMainWindow else {
self.windowController.close() self.windowController.close()
return return
} }
let windowIsOpen = self.window.isKeyWindow
// The window is open and the user changed the setting // The window is open and the user changed the setting
if self.usesVcsIgnores != curWinState.usesVcsIgnores && self.window.isKeyWindow { if self.usesVcsIgnores != curWinState.usesVcsIgnores && windowIsOpen {
self.usesVcsIgnores = curWinState.usesVcsIgnores self.usesVcsIgnores = curWinState.usesVcsIgnores
self.reset() self.reset()
@ -107,12 +108,14 @@ class OpenQuicklyWindow: NSObject,
return return
} }
if self.window.isKeyWindow { if windowIsOpen {
// already open, so do nothing // already open, so do nothing
return return
} }
self.usesVcsIgnores = curWinState.usesVcsIgnores self.usesVcsIgnores = curWinState.usesVcsIgnores
// TODO: read global vcs ignores
self.prepareSearch(curWinState: curWinState) self.prepareSearch(curWinState: curWinState)
self.windowController.showWindow(nil) self.windowController.showWindow(nil)
} }