提交 513055e2 编写于 作者: J Johannes Rieken

show a root element where there is outline-breadcrumbs but none are currently selected

上级 ebb69237
......@@ -71,6 +71,13 @@ class OutlineItem extends BreadcrumbsItem {
render(container: HTMLElement): void {
const { element, outline } = this.element;
if (element === outline) {
const element = dom.$('span', undefined, '');
container.appendChild(element);
return;
}
const templateId = outline.treeConfig.delegate.getTemplateId(element);
const renderer = outline.treeConfig.renderers.find(renderer => renderer.templateId === templateId);
if (!renderer) {
......
......@@ -29,7 +29,7 @@ type FileInfo = { path: FileElement[], folder?: IWorkspaceFolder };
export class OutlineElement2 {
constructor(
readonly element: any,
readonly element: IOutline<any> | any,
readonly outline: IOutline<any>
) { }
}
......@@ -108,6 +108,8 @@ export class BreadcrumbsModel {
for (let element of this._currentOutline.treeConfig.parentChainProvider.getBreadcrumbElements(activeEntry)) {
result.push(new OutlineElement2(element, this._currentOutline));
}
} else if (!this._currentOutline.isEmpty) {
result.push(new OutlineElement2(this._currentOutline, this._currentOutline));
}
return result;
......
......@@ -510,10 +510,10 @@ export class BreadcrumbsOutlinePicker extends BreadcrumbsPicker {
// this._outlineComparator.type = this._getOutlineItemCompareType(overrideConfiguration);
tree.setInput(input.outline);
// if (element !== model) {
tree.reveal(input.element, 0.5);
tree.setFocus([input.element], this._fakeEvent);
// }
if (input.element !== input.outline) {
tree.reveal(input.element, 0.5);
tree.setFocus([input.element], this._fakeEvent);
}
tree.domFocus();
return Promise.resolve();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册