提交 b7f9eddf 编写于 作者: M Matt Bierner

Allow passing viewColumn to simpleBrowser.api.open

上级 a1d5ea87
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册