Browse Source

Greyscreen fix (#3474)

Co-authored-by: Matt Rubens <[email protected]>
xyOz 9 months ago
parent
commit
86a03798d5

+ 2 - 0
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(),

+ 2 - 0
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