Преглед изворни кода

fix(editor): make tab close best-effort in DiffViewProvider.open (#11363)

0xMink пре 2 месеци
родитељ
комит
7df1a18ccb
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      src/integrations/editor/DiffViewProvider.ts

+ 5 - 1
src/integrations/editor/DiffViewProvider.ts

@@ -98,7 +98,11 @@ export class DiffViewProvider {
 
 		for (const tab of tabs) {
 			if (!tab.isDirty) {
-				await vscode.window.tabGroups.close(tab)
+				try {
+					await vscode.window.tabGroups.close(tab)
+				} catch (err) {
+					console.error(`Failed to close tab ${tab.label}`, err)
+				}
 			}
 			this.documentWasOpen = true
 		}