mirror of https://github.com/onivim/oni.git
Fix sidebar search
This commit is contained in:
parent
66a13f5b06
commit
111b813001
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue