Skip to content

Commit

Permalink
Disable configure keybinding for actions that do not support it (#220050
Browse files Browse the repository at this point in the history
)

disable configure keybinding if action does not support it
  • Loading branch information
benibenj authored Jul 5, 2024
1 parent c040699 commit f9af31c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vs/platform/actions/browser/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ export class WorkbenchToolBar extends ToolBar {
if (action instanceof MenuItemAction && action.menuKeybinding) {
primaryActions.push(action.menuKeybinding);
} else if (!(action instanceof SubmenuItemAction || action instanceof ToggleMenuAction)) {
const isDisabled = action.id.startsWith('statusbaraction'); // We can't support keybinding configuration for scm statusbar actions
primaryActions.push(createConfigureKeybindingAction(this._commandService, this._keybindingService, action.id, undefined, !isDisabled));
// only enable the configure keybinding action for actions that support keybindings
const supportsKeybindings = !!this._keybindingService.lookupKeybinding(action.id);
primaryActions.push(createConfigureKeybindingAction(this._commandService, this._keybindingService, action.id, undefined, supportsKeybindings));
}

// -- Hide Actions --
Expand Down

0 comments on commit f9af31c

Please sign in to comment.