open resource only when it's file (#11815)

This commit is contained in:
Maddy
2020-08-17 08:52:30 -07:00
committed by GitHub
parent 3192d056f2
commit b7e12cb8a7

View File

@@ -225,7 +225,7 @@ export class NotebookSearchView extends SearchView {
this.toggleCollapseStateDelayer.trigger(() => this.toggleExpandAction.onTreeCollapseStateChange())
));
this.treeSelectionChangeListener = this._register(this.tree.onDidChangeSelection(async (e) => {
if (this.tree.getSelection().length) {
if (this.tree.getSelection().length && this.tree.getSelection()[0] instanceof FileMatch) {
let element = this.tree.getSelection()[0] as Match;
const resource = element instanceof Match ? element.parent().resource : (<FileMatch>element).resource;
if (resource.fsPath.endsWith('.md')) {