Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions src/vs/workbench/browser/actions/listCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,34 +749,25 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
if (focused instanceof List || focused instanceof PagedList) {
const list = focused;

if (list.getSelection().length > 0) {
list.setSelection([]);
} else if (list.getFocus().length > 0) {
list.setFocus([]);
}
list.setSelection([]);
list.setFocus([]);
}

// ObjectTree
else if (focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) {
const list = focused;
const fakeKeyboardEvent = new KeyboardEvent('keydown');

if (list.getSelection().length > 0) {
list.setSelection([], fakeKeyboardEvent);
} else if (list.getFocus().length > 0) {
list.setFocus([], fakeKeyboardEvent);
}
list.setSelection([], fakeKeyboardEvent);
list.setFocus([], fakeKeyboardEvent);
}

// Tree
else if (focused) {
const tree = focused;

if (tree.getSelection().length) {
tree.clearSelection({ origin: 'keyboard' });
} else if (tree.getFocus()) {
tree.clearFocus({ origin: 'keyboard' });
}
tree.clearSelection({ origin: 'keyboard' });
tree.clearFocus({ origin: 'keyboard' });
}
}
});
Expand Down