diff --git a/src/features/preview.ts b/src/features/preview.ts index e0f6dd06..ec2f5c25 100644 --- a/src/features/preview.ts +++ b/src/features/preview.ts @@ -229,6 +229,9 @@ export class AsciidocPreview extends Disposable implements WebviewResourceProvid this.editor.dispose() disposeAll(this.disposables) + + clearTimeout(this.throttleTimer) + this.throttleTimer = undefined } // This method is invoked evrytime there is a document update @@ -358,6 +361,10 @@ export class AsciidocPreview extends Disposable implements WebviewResourceProvid clearTimeout(this.throttleTimer) this.throttleTimer = undefined + if (this._disposed) { + return + } + const document = await vscode.workspace.openTextDocument(resource) if (!this.forceUpdate && this.currentVersion && this.currentVersion.resource.fsPath === resource.fsPath &&