From 9b4f2fc926744182eb2ce9b4692fdc4080da4abb Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Mon, 31 Dec 2018 16:13:22 -0800 Subject: [PATCH] Fix #64158 - expand search filematch when there was only one filematch --- src/vs/workbench/parts/search/browser/searchView.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index cab73eadbbc..230e0856bbf 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -1273,7 +1273,9 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { // Do final render, then expand if just 1 file with less than 50 matches this.onSearchResultsChanged(); - if (this.viewModel.searchResult.count() === 1) { + + const collapseResults = this.configurationService.getValue('search').collapseResults; + if (collapseResults !== 'alwaysCollapse' && this.viewModel.searchResult.matches().length === 1) { const onlyMatch = this.viewModel.searchResult.matches()[0]; if (onlyMatch.count() < 50) { this.tree.expand(onlyMatch);