Skip to content

Commit 620b701

Browse files
edgardmessiasJohnstonCode
authored andcommitted
fix: Fixed diff gutter cache (close #483) (#596)
1 parent 5577bc2 commit 620b701

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/svnContentProvider.ts

+16-5
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,30 @@ export class SvnContentProvider
6868
await eventToPromise(onDidFocusWindow);
6969
}
7070

71-
Object.keys(this.cache).forEach(key => {
71+
// Don't check if no has repository changes
72+
if (this.changedRepositoryRoots.size === 0) {
73+
return;
74+
}
75+
76+
// Use copy to allow new items in parallel
77+
const roots = Array.from(this.changedRepositoryRoots);
78+
this.changedRepositoryRoots.clear();
79+
80+
const keys = Object.keys(this.cache);
81+
82+
cacheLoop:
83+
for (const key of keys) {
7284
const uri = this.cache[key].uri;
7385
const fsPath = uri.fsPath;
7486

75-
for (const root of this.changedRepositoryRoots) {
87+
for (const root of roots) {
7688
if (isDescendant(root, fsPath)) {
7789
this._onDidChange.fire(uri);
78-
return;
90+
continue cacheLoop;
7991
}
8092
}
81-
});
93+
}
8294

83-
this.changedRepositoryRoots.clear();
8495
}
8596

8697
public async provideTextDocumentContent(uri: Uri): Promise<string> {

0 commit comments

Comments
 (0)