mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-26 18:27:38 +01:00
Set selection to what is right clicked if outside selection
Fixes #122161
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user