From dadf9707a8add342fb00bd4976ef92f90d850d16 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 9 Mar 2016 17:27:01 +0100 Subject: [PATCH] outputServices.showOutput do nothing if the correct panel is already revealed fixes #3609 --- src/vs/workbench/parts/output/common/outputServices.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/output/common/outputServices.ts b/src/vs/workbench/parts/output/common/outputServices.ts index 36d377f8e04..8d89aaaa421 100644 --- a/src/vs/workbench/parts/output/common/outputServices.ts +++ b/src/vs/workbench/parts/output/common/outputServices.ts @@ -117,9 +117,14 @@ export class OutputService implements IOutputService { } public showOutput(channel: string, preserveFocus?: boolean): TPromise { + const panel = this.panelService.getActivePanel(); + if (this.activeChannel === channel && panel && panel.getId() === OUTPUT_PANEL_ID) { + return TPromise.as(panel); + } + this.activeChannel = channel; this.storageService.store(OUTPUT_ACTIVE_CHANNEL_KEY, this.activeChannel, StorageScope.WORKSPACE); - this._onActiveOutputChannel.fire(channel); // emit event that we a new channel is active + this._onActiveOutputChannel.fire(channel); // emit event that a new channel is active return this.panelService.openPanel(OUTPUT_PANEL_ID, !preserveFocus).then((outputPanel: OutputPanel) => { return outputPanel && outputPanel.setInput(OutputEditorInput.getInstance(this.instantiationService, channel), EditorOptions.create({ preserveFocus: preserveFocus })). -- GitLab