mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 04:23:32 +01:00
open image
This commit is contained in:
@@ -443,6 +443,7 @@ export interface IManagedMarkdownPreview {
|
||||
readonly onDidChangeViewState: vscode.Event<vscode.WebviewPanelOnDidChangeViewStateEvent>;
|
||||
|
||||
copyImage(id: string): void;
|
||||
openImage(imagePath: string): void;
|
||||
dispose(): void;
|
||||
refresh(): void;
|
||||
updateConfiguration(): void;
|
||||
@@ -524,6 +525,12 @@ export class StaticMarkdownPreview extends Disposable implements IManagedMarkdow
|
||||
});
|
||||
}
|
||||
|
||||
openImage(imagePath: string): void {
|
||||
const uri = vscode.Uri.file(imagePath);
|
||||
this._webviewPanel.reveal();
|
||||
vscode.commands.executeCommand('vscode.open', uri);
|
||||
}
|
||||
|
||||
private readonly _onDispose = this._register(new vscode.EventEmitter<void>());
|
||||
public readonly onDispose = this._onDispose.event;
|
||||
|
||||
@@ -679,6 +686,12 @@ export class DynamicMarkdownPreview extends Disposable implements IManagedMarkdo
|
||||
});
|
||||
}
|
||||
|
||||
openImage(imagePath: string): void {
|
||||
const uri = vscode.Uri.file(imagePath);
|
||||
this._webviewPanel.reveal();
|
||||
vscode.commands.executeCommand('vscode.open', uri);
|
||||
}
|
||||
|
||||
private readonly _onDisposeEmitter = this._register(new vscode.EventEmitter<void>());
|
||||
public readonly onDispose = this._onDisposeEmitter.event;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user