mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 00:09:30 +01:00
Merge pull request #305550 from mjbvz/dev/mjbvz/tense-dragon
Use `areUrisEqual` helper for better uri checks
This commit is contained in:
@@ -129,8 +129,9 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
|
||||
const watcher = this._register(vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(resource, '*')));
|
||||
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())) {
|
||||
// Only use the file system event when VS Code does not already know about the file.
|
||||
// This is needed to avoid duplicate refreshes
|
||||
if (!vscode.workspace.textDocuments.some(doc => areUrisEqual(doc.uri, uri))) {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user