Browse Source

Avoids opening tabs to the side when empty

main
Eric Amodio 2 years ago
parent
commit
dab32b58d0
2 changed files with 10 additions and 0 deletions
  1. +5
    -0
      src/system/utils.ts
  2. +5
    -0
      src/webviews/webviewBase.ts

+ 5
- 0
src/system/utils.ts View File

@ -130,6 +130,11 @@ export async function openWalkthrough(
stepId?: string,
openToSide: boolean = true,
): Promise<void> {
// Only open to side if there is an active tab
if (openToSide && window.tabGroups.activeTabGroup.activeTab == null) {
openToSide = false;
}
// Takes the following params: walkthroughID: string | { category: string, step: string } | undefined, toSide: boolean | undefined
void (await executeCoreCommand(
CoreCommands.OpenWalkthrough,

+ 5
- 0
src/webviews/webviewBase.ts View File

@ -79,6 +79,11 @@ export abstract class WebviewBase implements Disposable {
}
async show(column: ViewColumn = ViewColumn.Beside): Promise<void> {
// Only try to open beside if there is an active tab
if (column === ViewColumn.Beside && window.tabGroups.activeTabGroup.activeTab == null) {
column = ViewColumn.Active;
}
if (this._panel == null) {
this._panel = window.createWebviewPanel(
this.id,

Loading…
Cancel
Save