Allow passing viewColumn to simpleBrowser.api.open

This commit is contained in:
Matt Bierner 2021-01-13 15:41:29 -08:00
parent a1d5ea876c
commit b7f9eddf04
2 changed files with 6 additions and 2 deletions

View file

@ -38,7 +38,10 @@ export function activate(context: vscode.ExtensionContext) {
}
}));
context.subscriptions.push(vscode.commands.registerCommand(openApiCommand, (url: vscode.Uri, showOptions?: { preserveFocus?: boolean }) => {
context.subscriptions.push(vscode.commands.registerCommand(openApiCommand, (url: vscode.Uri, showOptions?: {
preserveFocus?: boolean,
viewColumn: vscode.ViewColumn,
}) => {
manager.show(url.toString(), showOptions);
}));

View file

@ -11,6 +11,7 @@ const localize = nls.loadMessageBundle();
export interface ShowOptions {
readonly preserveFocus?: boolean;
readonly viewColumn?: vscode.ViewColumn;
}
export class SimpleBrowserView extends Disposable {
@ -75,7 +76,7 @@ export class SimpleBrowserView extends Disposable {
public show(url: string, options?: ShowOptions) {
this._webviewPanel.webview.html = this.getHtml(url);
this._webviewPanel.reveal(undefined, options?.preserveFocus);
this._webviewPanel.reveal(options?.viewColumn, options?.preserveFocus);
}
private getHtml(url: string) {