Skip to content

Commit

Permalink
Open Editors: "Open to Side" with keyboard still activates group (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Feb 5, 2018
1 parent 598ab8a commit 415ee68
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,21 @@ export class OpenEditorsView extends ViewsViewletPanel {
}
*/
this.telemetryService.publicLog('workbenchActionExecuted', { id: 'workbench.files.openFile', from: 'openEditors' });

let position = this.model.positionOfGroup(element.group);
if (options.sideBySide && position !== Position.THREE) {
position++;
}
this.editorGroupService.activateGroup(this.model.groupAt(position));
this.editorService.openEditor(element.editor, options, position)
.done(() => this.editorGroupService.activateGroup(this.model.groupAt(position)), errors.onUnexpectedError);

const preserveActivateGroup = options.sideBySide && options.preserveFocus; // needed for https://github.com/Microsoft/vscode/issues/42399
if (!preserveActivateGroup) {
this.editorGroupService.activateGroup(this.model.groupAt(position)); // needed for https://github.com/Microsoft/vscode/issues/6672
}
this.editorService.openEditor(element.editor, options, position).done(() => {
if (!preserveActivateGroup) {
this.editorGroupService.activateGroup(this.model.groupAt(position));
}
}, errors.onUnexpectedError);
}
}

Expand Down

0 comments on commit 415ee68

Please sign in to comment.