Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Fix sidebar search #2489

Merged
merged 1 commit into from
Aug 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions browser/src/Services/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,22 @@ export class SearchPane {

this._onSearchStarted.dispatch()

const query = this._oni.search.findInFile(searchOpts)

query.start()

const query = (this._currentQuery = this._oni.search.findInFile(searchOpts))
const toQuickFixItem = (r: Oni.Search.ResultItem) => {
return {
filename: r.fileName,
lnum: r.line,
col: r.column,
text: r.text.trim(),
}
}
query.onSearchResults.subscribe(result => {
if (result.isComplete) {
this._onSearchCompleted.dispatch()
this._oni.populateQuickFix(result.items.map(toQuickFixItem))
}
})

this._currentQuery = query
query.start()
}
}

Expand Down