提交 d92d7962 编写于 作者: E Eric Amodio

Ensures welcome editor won't open more than once

上级 5727c820
......@@ -99,9 +99,17 @@ export class WelcomePageContribution implements IWorkbenchContribution {
return undefined;
});
} else {
const options: IEditorOptions = editorService.activeEditor
? { pinned: false, index: 0 }
: { pinned: false };
let options: IEditorOptions;
let editor = editorService.activeEditor;
if (editor) {
// Ensure that the welcome editor won't get opened more than once
if (editor.getTypeId() === welcomeInputTypeId || editorService.editors.some(e => e.getTypeId() === welcomeInputTypeId)) {
return undefined;
}
options = { pinned: false, index: 0 };
} else {
options = { pinned: false };
}
return instantiationService.createInstance(WelcomePage).openEditor(options);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册