1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-10-27 18:34:58 +03:00

GH-227 Guard against empty flat file items

This commit is contained in:
Tae Won Ha 2016-09-25 18:47:12 +02:00
parent 4a41685da6
commit 411897bea8
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
2 changed files with 5 additions and 2 deletions

View File

@ -37,6 +37,10 @@ class OpenQuicklyFilterOperation: Operation {
return
}
if self.flatFileItems.isEmpty {
return
}
let sorted: [ScoredFileItem]
if pattern.characters.count == 0 {
let truncatedItems = self.flatFileItems[0...min(self.maxResultCount, self.flatFileItems.count - 1)]

View File

@ -154,9 +154,8 @@ class OpenQuicklyWindowComponent: WindowComponent,
})
.addDisposableTo(self.perSessionDisposeBag)
self.cwd = mainWindow.cwd as URL
self.cwd = mainWindow.cwd
let flatFiles = self.fileItemService.flatFileItems(ofUrl: self.cwd)
.subscribeOn(self.userInitiatedScheduler)
self.searchStream
.subscribe(onNext: { [unowned self] pattern in