1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-26 23:36:08 +03:00

Merge pull request #638 from laibulle/feat/file_sort

Feat/file sort
This commit is contained in:
Tae Won Ha 2018-04-15 10:09:16 +02:00 committed by GitHub
commit 455e69ea22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -215,7 +215,13 @@ class FileOutlineView: NSOutlineView,
}
private func sortedChildren(of url: URL) -> [FileBrowserItem] {
return FileUtils.directDescendants(of: url).map(FileBrowserItem.init).sorted()
return FileUtils.directDescendants(of: url).map(FileBrowserItem.init).sorted{
if ($0.isDir == $1.isDir) {
return $0.url.absoluteString < $1.url.absoluteString
}
return $0.isDir
}
}
private func update(_ fileBrowserItem: FileBrowserItem) {
@ -344,7 +350,6 @@ extension FileOutlineView {
guard let fileBrowserItem = item as? FileBrowserItem else {
return false
}
return fileBrowserItem.url.isDir
}