mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
Fix #68469 - TreeResourceNavigator2 should open file on any keyboard selection change
This commit is contained in:
@@ -707,13 +707,14 @@ export class TreeResourceNavigator2<T, TFilterData> extends Disposable {
|
||||
return;
|
||||
}
|
||||
|
||||
const isKeyboardEvent = e.browserEvent instanceof KeyboardEvent;
|
||||
const isMiddleClick = e.browserEvent instanceof MouseEvent ? e.browserEvent.button === 1 : false;
|
||||
const isDoubleClick = e.browserEvent.detail === 2;
|
||||
const preserveFocus = (e.browserEvent instanceof KeyboardEvent && typeof (<SelectionKeyboardEvent>e.browserEvent).preserveFocus === 'boolean') ?
|
||||
!!(<SelectionKeyboardEvent>e.browserEvent).preserveFocus :
|
||||
!isDoubleClick;
|
||||
|
||||
if (this.tree.openOnSingleClick || isDoubleClick) {
|
||||
if (this.tree.openOnSingleClick || isDoubleClick || isKeyboardEvent) {
|
||||
const sideBySide = e.browserEvent instanceof MouseEvent && (e.browserEvent.ctrlKey || e.browserEvent.metaKey || e.browserEvent.altKey);
|
||||
this.open(preserveFocus, isDoubleClick || isMiddleClick, sideBySide);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user