mirror of
https://github.com/Microsoft/vscode
synced 2024-09-12 21:24:38 +00:00
Allow passing viewColumn to simpleBrowser.api.open
This commit is contained in:
parent
a1d5ea876c
commit
b7f9eddf04
|
@ -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);
|
||||
}));
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue