提交 4655b60a 编写于 作者: B Benjamin Pasero

editor service 💄

上级 682f3715
......@@ -280,17 +280,30 @@ export class EditorService extends Disposable implements EditorServiceImpl {
}
// Respect option to reveal an editor if it is open (not necessarily visible)
// Still prefer to reveal an editor in a group where the editor is active though.
if (!targetGroup) {
if ((options && options.revealIfOpened) || this.configurationService.getValue<boolean>('workbench.editor.revealIfOpen')) {
let groupWithInputActive: IEditorGroup | undefined = undefined;
let groupWithInputOpened: IEditorGroup | undefined = undefined;
for (const group of groupsByLastActive) {
if (group.isOpened(input) && group.isActive(input)) {
targetGroup = group;
break;
if (group.isOpened(input)) {
if (!groupWithInputOpened) {
groupWithInputOpened = group;
}
if (!groupWithInputActive && group.isActive(input)) {
groupWithInputActive = group;
}
}
if (group.isOpened(input) && !targetGroup) {
targetGroup = group;
if (groupWithInputOpened && groupWithInputActive) {
break; // we found all groups we wanted
}
}
// Prefer a target group where the input is visible
targetGroup = groupWithInputActive || groupWithInputOpened;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册