提交 c37dfb5f 编写于 作者: I isidor

set folder context if single folder and click outside of tree

上级 c82a81b1
......@@ -443,8 +443,8 @@ export class ExplorerView extends TreeViewsViewletPanel implements IExplorerView
// Update resource context based on focused element
this.disposables.push(this.explorerViewer.onDidChangeFocus((e: { focus: FileStat }) => {
this.resourceContext.set(e.focus && e.focus.resource);
// TODO@Isidor take care of single folder top
this.folderContext.set(e.focus && e.focus.isDirectory);
const isSingleFolder = this.contextService.getWorkbenchState() === WorkbenchState.FOLDER;
this.folderContext.set((isSingleFolder && !e.focus) || e.focus && e.focus.isDirectory);
this.rootContext.set(!e.focus || (e.focus && e.focus.isRoot));
}));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册