Skip to content

Commit

Permalink
fix microsoft#51039 mapResourceToEditorCount for SideBySideEditorInpu…
Browse files Browse the repository at this point in the history
…t.details
  • Loading branch information
MarekLew committed Jun 30, 2018
1 parent 5008209 commit e0d8189
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/vs/workbench/common/editor/editorStacksModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ export class EditorGroup implements IEditorGroup {
}
}

private splice(index: number, del: boolean, editor?: EditorInput): void {
private splice(index: number, del: boolean, editor?: EditorInput | SideBySideEditorInput): void {
const editorToDeleteOrReplace = this.editors[index];

const args: any[] = [index, del ? 1 : 0];
Expand Down Expand Up @@ -569,7 +569,10 @@ export class EditorGroup implements IEditorGroup {
}
}

private updateResourceMap(editor: EditorInput, remove: boolean): void {
private updateResourceMap(editor: EditorInput | SideBySideEditorInput, remove: boolean): void {
if (editor instanceof SideBySideEditorInput) {
this.updateResourceMap(editor.details, remove);
}
const resource = toResource(editor, { supportSideBySide: true });
if (resource) {

Expand Down Expand Up @@ -1221,6 +1224,7 @@ export class EditorStacksModel implements IEditorStacksModel {

// Close the editor when it is no longer open in any group including diff editors
editorsToClose.forEach(editorToClose => {

const resource = editorToClose ? editorToClose.getResource() : void 0; // prefer resource to not close right-hand side editors of a diff editor
if (!this.isOpen(resource || editorToClose)) {
editorToClose.close();
Expand Down

0 comments on commit e0d8189

Please sign in to comment.