From 2796e32c74ed4806c321039b8b0f1396ff0f8f06 Mon Sep 17 00:00:00 2001 From: Magyarimiki <249292183+Magyarimiki@users.noreply.github.com> Date: Thu, 29 Jan 2026 15:50:10 +0100 Subject: [PATCH] Prevent handling onDidChangeActiveTextEditor twice Signed-off-by: Magyarimiki <249292183+Magyarimiki@users.noreply.github.com> --- src/sidebar/views/reports.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sidebar/views/reports.ts b/src/sidebar/views/reports.ts index 70ac9a5..e6b71bf 100644 --- a/src/sidebar/views/reports.ts +++ b/src/sidebar/views/reports.ts @@ -93,7 +93,14 @@ export class ReportsView implements TreeDataProvider { constructor(ctx: ExtensionContext) { ctx.subscriptions.push(this._onDidChangeTreeData = new EventEmitter()); - window.onDidChangeActiveTextEditor(this.refreshBugList, this, ctx.subscriptions); + window.onDidChangeActiveTextEditor(editor => { + // this event is called twice by vscode. Ignore deactivation of the old editor. + if (!editor) { + return; + } + + this.refreshBugList(); + }, this, ctx.subscriptions); ExtensionApi.diagnostics.diagnosticsUpdated(() => { // FIXME: fired twice when a file is opened freshly.