From 02d6ef4ced36ac13a971e03824ebfca3f2d97da9 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sat, 18 Jan 2020 16:33:42 +0100 Subject: [PATCH] Wip --- VimR/VimR/OpenQuicklyWindow.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/VimR/VimR/OpenQuicklyWindow.swift b/VimR/VimR/OpenQuicklyWindow.swift index d39cf18a..45cd7cda 100644 --- a/VimR/VimR/OpenQuicklyWindow.swift +++ b/VimR/VimR/OpenQuicklyWindow.swift @@ -91,14 +91,15 @@ class OpenQuicklyWindow: NSObject, private func subscription(_ state: StateType) { self.updateRootUrls(state: state) - guard state.openQuickly.open, - let curWinState = state.currentMainWindow else { + guard state.openQuickly.open, let curWinState = state.currentMainWindow else { self.windowController.close() return } + let windowIsOpen = self.window.isKeyWindow + // 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.reset() @@ -107,12 +108,14 @@ class OpenQuicklyWindow: NSObject, return } - if self.window.isKeyWindow { + if windowIsOpen { // already open, so do nothing return } self.usesVcsIgnores = curWinState.usesVcsIgnores + + // TODO: read global vcs ignores self.prepareSearch(curWinState: curWinState) self.windowController.showWindow(nil) }