Skip to content

Commit 8fb656a

Browse files
authored
Avoid changing layout if the panel is already visible (#2344)
As it was, it would constantly rearrange the panels when you re-run a histogram etc. even if it was already visible and you'd laid out the panels to your liking.
1 parent 638fa40 commit 8fb656a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

vscode/src/webviewPanel.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,13 @@ export class QSharpWebViewPanel {
529529
}
530530

531531
reveal(column: ViewColumn) {
532-
this.panel.reveal(column, true);
532+
// If it's already visible, don't do anything else it messes up the existing layout
533+
// This isn't perfect, as if the tab is just in the background it will still call
534+
// reveal to bring to the foreground and change the layout, but this is the best we
535+
// can do with the current API.
536+
if (!this.panel.visible) {
537+
this.panel.reveal(column, true);
538+
}
533539
}
534540

535541
private _getWebviewContent(webview: Webview) {

0 commit comments

Comments
 (0)