From c134db912c4626aed83c5b55724188c9fefe4f39 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Thu, 7 Nov 2019 18:16:55 +0100 Subject: [PATCH] Update decorations when clearing search fix #6498 Signed-off-by: Eric Schmidt --- .../browser/search-in-workspace-result-tree-widget.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx b/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx index c7b7ed47ee9c5..82756e7287185 100644 --- a/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx +++ b/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx @@ -315,9 +315,13 @@ export class SearchInWorkspaceResultTreeWidget extends TreeWidget { if (currentTitle && currentTitle.owner instanceof EditorWidget) { const widget = currentTitle.owner; const fileNodes = this.getFileNodesByUri(widget.editor.uri); - fileNodes.forEach(node => { - this.decorateEditor(node, widget); - }); + if (fileNodes.length > 0) { + fileNodes.forEach(node => { + this.decorateEditor(node, widget); + }); + } else { + this.decorateEditor(undefined, widget); + } } });