From bd66b4cd77da90f09ac1f1fba75621fc98fcd19d Mon Sep 17 00:00:00 2001 From: xyOz Date: Tue, 13 May 2025 03:39:07 +0100 Subject: [PATCH] Greyscreen fix (#3474) Co-authored-by: Matt Rubens --- src/core/task/__tests__/Task.test.ts | 2 ++ src/integrations/editor/DiffViewProvider.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/core/task/__tests__/Task.test.ts b/src/core/task/__tests__/Task.test.ts index 0bffc4a179..a5a6efa63e 100644 --- a/src/core/task/__tests__/Task.test.ts +++ b/src/core/task/__tests__/Task.test.ts @@ -61,6 +61,7 @@ jest.mock("vscode", () => { const mockTabGroup = { tabs: [mockTab] } return { + TabInputTextDiff: jest.fn(), CodeActionKind: { QuickFix: { value: "quickfix" }, RefactorRewrite: { value: "refactor.rewrite" }, @@ -72,6 +73,7 @@ jest.mock("vscode", () => { visibleTextEditors: [mockTextEditor], tabGroups: { all: [mockTabGroup], + close: jest.fn(), onDidChangeTabs: jest.fn(() => ({ dispose: jest.fn() })), }, showErrorMessage: jest.fn(), diff --git a/src/integrations/editor/DiffViewProvider.ts b/src/integrations/editor/DiffViewProvider.ts index 0bf494854a..aad715f0ae 100644 --- a/src/integrations/editor/DiffViewProvider.ts +++ b/src/integrations/editor/DiffViewProvider.ts @@ -353,6 +353,8 @@ export class DiffViewProvider { // close editor if open? async reset() { + // Ensure any diff views opened by this provider are closed to release memory + await this.closeAllDiffViews(); this.editType = undefined this.isEditing = false this.originalContent = undefined