Set selection to what is right clicked if outside selection
Fixes #122161
This commit is contained in:
parent
50b10894ce
commit
5bf77b350f
1 changed files with 12 additions and 0 deletions
|
@ -104,6 +104,18 @@ export class TerminalTabsWidget extends WorkbenchObjectTree<ITerminalInstance>
|
|||
}
|
||||
});
|
||||
|
||||
// Set the selection to whatever is right clicked if it is not inside the selection
|
||||
this.onContextMenu(e => {
|
||||
if (!e.element) {
|
||||
this.setSelection([null]);
|
||||
return;
|
||||
}
|
||||
const selection = this.getSelection();
|
||||
if (!selection || !selection.find(s => e.element === s)) {
|
||||
this.setSelection([e.element]);
|
||||
}
|
||||
});
|
||||
|
||||
this._terminalTabsSingleSelectedContextKey = KEYBINDING_CONTEXT_TERMINAL_TABS_SINGULAR_SELECTION.bindTo(contextKeyService);
|
||||
|
||||
this.onDidChangeSelection(e => {
|
||||
|
|
Loading…
Reference in a new issue