diff --git a/src/views/nodes/fileHistoryTrackerNode.ts b/src/views/nodes/fileHistoryTrackerNode.ts index 8af2f0423f2ea..caa08e83b58b2 100644 --- a/src/views/nodes/fileHistoryTrackerNode.ts +++ b/src/views/nodes/fileHistoryTrackerNode.ts @@ -153,6 +153,12 @@ export class FileHistoryTrackerNode extends SubscribeableViewNode<'file-history- void this._triggerChangeDebounced(); return; } + + // Only trigger change if the editor's URI is different from the current one + if (!editor?.document?.uri || areUrisEqual(editor.document.uri, this.uri)) { + return; + } + void this.triggerChange(); }