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

Commit

Permalink
Fix sidebar search (#2489)
Browse files Browse the repository at this point in the history
  • Loading branch information
TalAmuyal authored Aug 5, 2018
1 parent 66a13f5 commit 60c647e
Showing 1 changed file with 11 additions and 6 deletions.
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

0 comments on commit 60c647e

Please sign in to comment.