提交 65bdd32d 编写于 作者: I isidor

Revert "respect onDidOpenResource passed element"

This reverts commit 8b91600b.
上级 83325095
......@@ -412,18 +412,18 @@ export class ExplorerView extends ViewPane {
this._register(explorerNavigator);
// Open when selecting via keyboard
this._register(explorerNavigator.onDidOpenResource(async e => {
const element = e.element;
const selection = this.tree.getSelection();
// Do not react if the user is expanding selection via keyboard.
// Check if the item was previously also selected, if yes the user is simply expanding / collapsing current selection #66589.
const shiftDown = e.browserEvent instanceof KeyboardEvent && e.browserEvent.shiftKey;
if (element && !shiftDown) {
if (element.isDirectory || this.explorerService.isEditable(undefined)) {
if (selection.length === 1 && !shiftDown) {
if (selection[0].isDirectory || this.explorerService.isEditable(undefined)) {
// Do not react if user is clicking on explorer items while some are being edited #70276
// Do not react if clicking on directories
return;
}
this.telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', { id: 'workbench.files.openFile', from: 'explorer' });
await this.editorService.openEditor({ resource: element.resource, options: { preserveFocus: e.editorOptions.preserveFocus, pinned: e.editorOptions.pinned } }, e.sideBySide ? SIDE_GROUP : ACTIVE_GROUP);
await this.editorService.openEditor({ resource: selection[0].resource, options: { preserveFocus: e.editorOptions.preserveFocus, pinned: e.editorOptions.pinned } }, e.sideBySide ? SIDE_GROUP : ACTIVE_GROUP);
}
}));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册