From 157541d500852e1eb20ef441b217743e455f93f5 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sun, 11 Sep 2016 14:37:04 +0200 Subject: [PATCH] Fix some bugs of open quickly window - do not scan packages - do not crash when switching between neovim windows - do not allow fullscreen - close when losing focus --- VimR/Base.lproj/OpenQuicklyWindow.xib | 1 + VimR/FileItem.swift | 2 ++ VimR/FileItemService.swift | 2 +- VimR/FoundationCommons.swift | 4 ++++ VimR/OpenQuicklyWindowComponent.swift | 5 +++++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/VimR/Base.lproj/OpenQuicklyWindow.xib b/VimR/Base.lproj/OpenQuicklyWindow.xib index 64d49612..ce160c0d 100644 --- a/VimR/Base.lproj/OpenQuicklyWindow.xib +++ b/VimR/Base.lproj/OpenQuicklyWindow.xib @@ -14,6 +14,7 @@ + diff --git a/VimR/FileItem.swift b/VimR/FileItem.swift index 7ee7b8c4..751c08cf 100644 --- a/VimR/FileItem.swift +++ b/VimR/FileItem.swift @@ -10,6 +10,7 @@ class FileItem : CustomStringConvertible { let url: NSURL let dir: Bool let hidden: Bool + let package: Bool /// When nil, then it has never been fnmatch'ed. weak var ignoreToken: Token? @@ -31,6 +32,7 @@ class FileItem : CustomStringConvertible { self.url = url self.dir = url.dir self.hidden = url.hidden + self.package = url.package } func removeChild(withUrl url: NSURL) { diff --git a/VimR/FileItemService.swift b/VimR/FileItemService.swift index d420dd52..ea3e8759 100644 --- a/VimR/FileItemService.swift +++ b/VimR/FileItemService.swift @@ -154,7 +154,7 @@ class FileItemService { curItem.children .filter { item in - if item.hidden { + if item.hidden || item.package { return false } diff --git a/VimR/FoundationCommons.swift b/VimR/FoundationCommons.swift index 0d43f5d0..5b25ac9e 100644 --- a/VimR/FoundationCommons.swift +++ b/VimR/FoundationCommons.swift @@ -54,6 +54,10 @@ extension NSURL { var hidden: Bool { return self.resourceValue(NSURLIsHiddenKey) } + + var package: Bool { + return self.resourceValue(NSURLIsPackageKey) + } } extension Array { diff --git a/VimR/OpenQuicklyWindowComponent.swift b/VimR/OpenQuicklyWindowComponent.swift index 843dbabf..0f041b31 100644 --- a/VimR/OpenQuicklyWindowComponent.swift +++ b/VimR/OpenQuicklyWindowComponent.swift @@ -308,8 +308,13 @@ extension OpenQuicklyWindowComponent { self.pattern = "" self.flatFileItems = [] self.fileViewItems = [] + self.fileView.reloadData() self.searchField.stringValue = "" self.countField.stringValue = "0 items" } + + func windowDidResignKey(notification: NSNotification) { + self.window.performClose(self) + } }