diff --git a/VimR/FileItemService.swift b/VimR/FileItemService.swift index ecbbde3a..f71f68b8 100644 --- a/VimR/FileItemService.swift +++ b/VimR/FileItemService.swift @@ -105,7 +105,7 @@ class FileItemService: StandardFlow { // TODO Remove cached items more aggressively? let hasRelations = self.monitors.keys.reduce(false) { (result, monitoredUrl) in - return result ? result : monitoredUrl.parent(ofUrl: url) || url.parent(ofUrl: monitoredUrl) + return result ? result : monitoredUrl.isParent(of: url) || url.isParent(of: monitoredUrl) } if hasRelations { diff --git a/VimR/FileOutlineView.swift b/VimR/FileOutlineView.swift index b5ff1848..cc1460d4 100644 --- a/VimR/FileOutlineView.swift +++ b/VimR/FileOutlineView.swift @@ -62,7 +62,7 @@ extension FileOutlineView { self.fileItems.remove(fileItem) if fileItem.dir { self.fileItems - .filter { fileItem.url.parent(ofUrl: $0.url) } + .filter { fileItem.url.isParent(of: $0.url) } .forEach { self.fileItems.remove($0) } } } diff --git a/VimR/FoundationCommons.swift b/VimR/FoundationCommons.swift index 052deb94..ca3acb5d 100644 --- a/VimR/FoundationCommons.swift +++ b/VimR/FoundationCommons.swift @@ -7,7 +7,7 @@ import Foundation extension URL { - func parent(ofUrl url: URL) -> Bool { + func isParent(of url: URL) -> Bool { guard self.isFileURL && url.isFileURL else { return false }