From 0d1c4944c1e473b424e7c5b9aa61cc77c2f5f2cb Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Thu, 9 Jan 2025 21:22:44 -0800 Subject: [PATCH] only open 1 editor --- .../workbench/contrib/void/browser/voidSettingsPane.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/void/browser/voidSettingsPane.ts b/src/vs/workbench/contrib/void/browser/voidSettingsPane.ts index 34b7b902..c69596eb 100644 --- a/src/vs/workbench/contrib/void/browser/voidSettingsPane.ts +++ b/src/vs/workbench/contrib/void/browser/voidSettingsPane.ts @@ -143,9 +143,8 @@ registerAction2(class extends Action2 { const editorService = accessor.get(IEditorService); const instantiationService = accessor.get(IInstantiationService); - const openEditors = editorService.findEditors(VoidSettingsInput.RESOURCE); - // close all instances if found + const openEditors = editorService.findEditors(VoidSettingsInput.RESOURCE); if (openEditors.length > 0) { await editorService.closeEditors(openEditors); return; @@ -173,6 +172,13 @@ registerAction2(class extends Action2 { const editorService = accessor.get(IEditorService); const instantiationService = accessor.get(IInstantiationService); + // close all instances if found + const openEditors = editorService.findEditors(VoidSettingsInput.RESOURCE); + if (openEditors.length > 0) { + await editorService.closeEditors(openEditors); + } + + // then, open one single editor const input = instantiationService.createInstance(VoidSettingsInput); await editorService.openEditor(input); }