Fix webviews not restoring html properly

This commit is contained in:
Matt Bierner
2018-02-28 11:44:30 -08:00
parent 7d8c3bb953
commit 85d47a74cb

View File

@@ -49,6 +49,7 @@ class WebviewInput extends EditorInput {
private _name: string;
private _options: vscode.WebviewOptions;
private _html: string;
private _currentWebviewHtml: string = '';
private _events: WebviewEvents | undefined;
private _container: HTMLElement;
private _webview: Webview | undefined;
@@ -56,6 +57,7 @@ class WebviewInput extends EditorInput {
private _webviewDisposables: IDisposable[] = [];
private _position: Position;
public static create(
resource: URI,
name: string,
@@ -138,7 +140,7 @@ class WebviewInput extends EditorInput {
}
public setHtml(value: string): void {
if (value === this._html) {
if (value === this._currentWebviewHtml) {
return;
}
@@ -146,6 +148,7 @@ class WebviewInput extends EditorInput {
if (this._webview) {
this._webview.contents = value;
this._currentWebviewHtml = value;
}
}
@@ -218,7 +221,7 @@ class WebviewInput extends EditorInput {
this._webviewOwner = undefined;
this.container.style.visibility = 'hidden';
this._html = '';
this._currentWebviewHtml = '';
}
public onDidChangePosition(position: Position) {