Better active editor check logic
This commit is contained in:
parent
f1bbe6611d
commit
59ccce16da
|
@ -124,12 +124,9 @@ export class EditorOverrideService extends Disposable implements IEditorOverride
|
|||
}
|
||||
|
||||
// If it's the currently active editor we shouldn't do anything
|
||||
const currentEditor = firstOrDefault(group.findEditors(resource));
|
||||
let currentViewType = undefined;
|
||||
if (currentEditor) {
|
||||
currentViewType = (currentEditor as IRegisteredEditorInput).viewType;
|
||||
}
|
||||
if (currentViewType && selectedEditor.editorInfo.id === currentViewType) {
|
||||
const currentEditors = group.findEditors(resource);
|
||||
const isActive = currentEditors.find(editor => (editor as IRegisteredEditorInput).viewType === selectedEditor.editorInfo.id);
|
||||
if (isActive) {
|
||||
return OverrideStatus.ABORT;
|
||||
}
|
||||
const input = await this.doOverrideEditorInput(resource, editor, options, group, selectedEditor);
|
||||
|
|
Loading…
Reference in a new issue