Fix markdown preview refresh from disk (#161800)

Fixes #149974
This commit is contained in:
Matt Bierner 2022-09-26 09:49:53 -07:00 committed by GitHub
parent 0b1c344d5d
commit b8a7485526
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -158,7 +158,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
this._register(watcher.onDidChange(uri => {
if (this.isPreviewOf(uri)) {
// Only use the file system event when VS Code does not already know about the file
if (!vscode.workspace.textDocuments.some(doc => doc.uri.toString() !== uri.toString())) {
if (!vscode.workspace.textDocuments.some(doc => doc.uri.toString() === uri.toString())) {
this.refresh();
}
}