diff --git a/src/vs/workbench/parts/search/common/searchModel.ts b/src/vs/workbench/parts/search/common/searchModel.ts index 0b6feaae55628a5e3ab0a889356d663e746d9c16..b1921185756698f21a2b3c07e2202684b284aee5 100644 --- a/src/vs/workbench/parts/search/common/searchModel.ts +++ b/src/vs/workbench/parts/search/common/searchModel.ts @@ -244,14 +244,14 @@ export class FileMatch extends Disposable { private updateMatches(matches: FindMatch[], modelChange: boolean) { const textSearchResults = editorMatchesToTextSearchResults(matches, this._model, this._previewOptions); textSearchResults.forEach(textSearchResult => { - const match = new Match(this, textSearchResult); - - if (!this._removedMatches.has(match.id())) { - this.add(match); - if (this.isMatchSelected(match)) { - this._selectedMatch = match; + textSearchResultToMatches(textSearchResult, this).forEach(match => { + if (!this._removedMatches.has(match.id())) { + this.add(match); + if (this.isMatchSelected(match)) { + this._selectedMatch = match; + } } - } + }); }); this._onChange.fire(modelChange);