提交 c3fa622d 编写于 作者: I isidor

open editors view: better index computation

fixes #39377
上级 c05d89eb
......@@ -212,24 +212,16 @@ export class OpenEditorsView extends ViewsViewletPanel {
}
private getIndex(group: IEditorGroup, editor: IEditorInput): number {
let index = 0;
let index = editor ? group.indexOf(editor) : 0;
if (this.model.groups.length === 1) {
return index;
}
for (let g of this.model.groups) {
if (this.model.groups.length > 1) {
index++;
}
if (g.id !== group.id) {
index += g.getEditors().length;
if (g.id === group.id) {
return index + 1;
} else {
if (!editor) {
return index - 1;
}
for (let e of g.getEditors()) {
if (e.getResource().toString() !== editor.getResource().toString()) {
index++;
} else {
return index;
}
}
index += g.count + 1;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册