File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -211,22 +211,14 @@ export class DiffViewProvider {
211211
212212 // If the file was already open, close it (must happen after showing the
213213 // diff view since if it's the only tab the column will close).
214- this . documentWasOpen = false
215-
216- // Close the tab if it's open (it's already saved above).
217- const tabs = vscode . window . tabGroups . all
218- . map ( ( tg ) => tg . tabs )
219- . flat ( )
220- . filter (
221- ( tab ) => tab . input instanceof vscode . TabInputText && arePathsEqual ( tab . input . uri . fsPath , absolutePath ) ,
222- )
223-
224- for ( const tab of tabs ) {
225- if ( ! tab . isDirty ) {
226- await vscode . window . tabGroups . close ( tab )
227- }
228- this . documentWasOpen = true
229- }
214+ this . documentWasOpen =
215+ vscode . window . tabGroups . all
216+ . map ( ( tg ) => tg . tabs )
217+ . flat ( )
218+ . filter (
219+ ( tab ) =>
220+ tab . input instanceof vscode . TabInputText && arePathsEqual ( tab . input . uri . fsPath , absolutePath ) ,
221+ ) . length > 0
230222
231223 this . activeDiffEditor = await this . openDiffEditor ( )
232224 this . fadedOverlayController = new DecorationController ( "fadedOverlay" , this . activeDiffEditor )
You can’t perform that action at this time.
0 commit comments