Skip to content

Commit b55887a

Browse files
authored
Fix tree selection context and command args (microsoft#211429) (microsoft#211435)
Fixes microsoft#210046
1 parent 2fb3fa8 commit b55887a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vs/workbench/browser/parts/views/treeView.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -801,9 +801,10 @@ abstract class AbstractTreeView extends Disposable implements ITreeView {
801801

802802
this.tree!.setFocus([node]);
803803
let selected = this.canSelectMany ? this.getSelection() : [];
804-
if (selected.length === 0) {
804+
if (!selected.find(item => item.handle === node.handle)) {
805805
selected = [node];
806806
}
807+
807808
const actions = treeMenus.getResourceContextActions(selected);
808809
if (!actions.length) {
809810
return;
@@ -1567,8 +1568,8 @@ class MultipleSelectionActionRunner extends ActionRunner {
15671568
});
15681569
}
15691570

1570-
if (!actionInSelected && selectionHandleArgs && selectionHandleArgs.length > 0) {
1571-
context = selectionHandleArgs[0];
1571+
if (!actionInSelected && selectionHandleArgs) {
1572+
selectionHandleArgs = undefined;
15721573
}
15731574

15741575
await action.run(context, selectionHandleArgs);

0 commit comments

Comments
 (0)