Skip to content

Commit

Permalink
fixes #42398
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn committed Jan 30, 2018
1 parent c4bf22f commit eed7e19
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/vs/workbench/browser/parts/editor/editorCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,23 +335,17 @@ function registerEditorCommands() {
const group = model.getGroup(groupId);
const position = model.positionOfGroup(group);
if (position >= 0) {
editorsToClose.set(position, contexts.map(c => {
if (c && groupId === c.groupId) {
let input = group.getEditor(c.editorIndex);
if (!input) {

// Get Top Editor at Position
const visibleEditors = editorService.getVisibleEditors();
if (visibleEditors[position]) {
input = visibleEditors[position].input;
}
}

return input;
const inputs = contexts.map(c => {
if (c && groupId === c.groupId && types.isNumber(c.editorIndex)) {
return group.getEditor(c.editorIndex);
}

return void 0;
}).filter(input => !!input));
return undefined;
}).filter(input => !!input);

if (inputs.length) {
editorsToClose.set(position, inputs);
}
}
});

Expand Down

0 comments on commit eed7e19

Please sign in to comment.