Skip to content

Commit

Permalink
fixes #42584
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn committed Jan 31, 2018
1 parent 9a1f471 commit 95e80bb
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/vs/workbench/parts/files/electron-browser/fileCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const editorService = accessor.get(IWorkbenchEditorService);
const editorGroupService = accessor.get(IEditorGroupService);
const listService = accessor.get(IListService);
const fileService = accessor.get(IFileService);
const tree = listService.lastFocusedList;
const resources = getMultiSelectedResources(resource, listService, editorService);
const stacks = editorGroupService.getStacksModel();
Expand All @@ -279,17 +280,19 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({

// Set side input
if (resources.length) {
return editorService.openEditors(resources.map(resource => {
return {
return fileService.resolveFiles(resources.map(resource => ({ resource }))).then(resolved => {
const editors = resolved.filter(r => r.success && !r.stat.isDirectory).map(r => ({
input: {
resource,
resource: r.stat.resource,
options: { preserveFocus: false }
}
};
}), true).then(() => {
if (activeGroup) {
editorGroupService.focusGroup(stacks.positionOfGroup(activeGroup) + 1);
}
}));

return editorService.openEditors(editors, true).then(() => {
if (activeGroup) {
editorGroupService.focusGroup(stacks.positionOfGroup(activeGroup) + 1);
}
});
});
}

Expand Down

0 comments on commit 95e80bb

Please sign in to comment.