Skip to content

Commit

Permalink
Use relativepattern for file watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Feb 22, 2022
1 parent 4630133 commit 1678c27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extensions/image-preview/src/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Preview extends Disposable {
this._previewState = PreviewState.Disposed;
}));

const watcher = this._register(vscode.workspace.createFileSystemWatcher(resource.fsPath));
const watcher = this._register(vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(resource, '*')));
this._register(watcher.onDidChange(e => {
if (e.toString() === this.resource.toString()) {
this.render();
Expand Down

0 comments on commit 1678c27

Please sign in to comment.