Skip to content

Commit

Permalink
TreeWidget: Ensure globalSelection is correctly set when opening cont…
Browse files Browse the repository at this point in the history
…ext menu (#13710)

* TreeWidget: Ensure globalSelection is correctly set when opening context menu

Signed-off-by: Jonah Iden <[email protected]>

* nicer solution than only checking when opening context menu

Signed-off-by: Jonah Iden <[email protected]>

* lint

Signed-off-by: Jonah Iden <[email protected]>

* removed forgotten artifact

Signed-off-by: Jonah Iden <[email protected]>

---------

Signed-off-by: Jonah Iden <[email protected]>
  • Loading branch information
jonah-iden authored May 15, 2024
1 parent 38eb319 commit cb2bd96
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/core/src/browser/tree/tree-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,12 @@ export class TreeWidget extends ReactWidget implements StatefulWidget {
}
})
]);

this.node.addEventListener('focusin', e => {
if (this.model.selectedNodes.length && (!this.selectionService.selection || !TreeWidgetSelection.isSource(this.selectionService.selection, this))) {
this.updateGlobalSelection();
}
});
}
this.toDispose.push(this.corePreferences.onPreferenceChanged(preference => {
if (preference.preferenceName === 'workbench.tree.renderIndentGuides') {
Expand Down

0 comments on commit cb2bd96

Please sign in to comment.