diff --git a/package-lock.json b/package-lock.json index 6f45620..c36920e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "djot-vscode", - "version": "0.1.0", + "version": "0.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "djot-vscode", - "version": "0.1.0", + "version": "0.2.1", "license": "MIT", "dependencies": { "@djot/djot": "^0.3.1", diff --git a/package.json b/package.json index 265e7c6..278f393 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "author": "ryanabx, contributors", "repository": "https://github.com/ryanabx/djot-vscode", "bugs": "https://github.com/ryanabx/djot-vscode/issues/new", - "version": "0.2.1", + "version": "0.2.2", "engines": { "vscode": "^1.92.0" }, diff --git a/src/preview/preview.ts b/src/preview/preview.ts index 4c4d1fd..353196e 100644 --- a/src/preview/preview.ts +++ b/src/preview/preview.ts @@ -256,7 +256,8 @@ class DjotPreview extends Disposable implements WebviewResourceProvider { return; } - const shouldReloadPage = forceUpdate || !this._currentVersion || this._currentVersion.resource.toString() !== pendingVersion.resource.toString() || !this._webviewPanel.visible; + const shouldReloadPage = true; // TODO: Fix this condition shouldReloadPage + // const shouldReloadPage = forceUpdate || !this._currentVersion || this._currentVersion.resource.toString() !== pendingVersion.resource.toString() || !this._webviewPanel.visible; this._currentVersion = pendingVersion; let selectedLine: number | undefined = undefined; @@ -267,6 +268,7 @@ class DjotPreview extends Disposable implements WebviewResourceProvider { } } + const content = await (shouldReloadPage ? this._contentProvider.renderDocument(document, this, this._previewConfigurations, this._line, selectedLine, this.state, this._imageInfo, this._disposeCts.token) : this._contentProvider.renderBody(document, this)); @@ -274,8 +276,7 @@ class DjotPreview extends Disposable implements WebviewResourceProvider { // Another call to `doUpdate` may have happened. // Make sure we are still updating for the correct document if (this._currentVersion?.equals(pendingVersion)) { - // this._updateWebviewContent(content.html, shouldReloadPage); - this._updateWebviewContent(content.html, true); // TODO: Fix this condition shouldReloadPage + this._updateWebviewContent(content.html, shouldReloadPage); } }