Skip to content

Commit

Permalink
Retain previous quick pick navigation behavior with Home and End (#21…
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerLeonhardt authored May 29, 2024
1 parent 77b1d90 commit b6298d8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/vs/platform/quickinput/browser/quickInputActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ function registerQuickPickCommandAndKeybindingRule(rule: PartialExcept<ICommandA
});
}

const ctrlKeyMod = isMacintosh ? KeyMod.WinCtrl : KeyMod.CtrlCmd;

// This function will generate all the combinations of keybindings for the given primary keybinding
function getSecondary(primary: number, secondary: number[], options: { withAltMod?: boolean; withCtrlMod?: boolean; withCmdMod?: boolean } = {}): number[] {
if (options.withAltMod) {
secondary.push(KeyMod.Alt + primary);
}
const ctrlKeyMod = isMacintosh ? KeyMod.WinCtrl : KeyMod.CtrlCmd;
if (options.withCtrlMod) {
secondary.push(ctrlKeyMod + primary);
if (options.withAltMod) {
Expand Down Expand Up @@ -81,12 +82,12 @@ registerQuickPickCommandAndKeybindingRule(
{ withAltMod: true, withCtrlMod: true, withCmdMod: true }
);
registerQuickPickCommandAndKeybindingRule(
{ id: 'quickInput.first', primary: KeyCode.Home, handler: focusHandler(QuickPickFocus.First) },
{ withAltMod: true, withCtrlMod: true, withCmdMod: true }
{ id: 'quickInput.first', primary: ctrlKeyMod + KeyCode.Home, handler: focusHandler(QuickPickFocus.First) },
{ withAltMod: true, withCmdMod: true }
);
registerQuickPickCommandAndKeybindingRule(
{ id: 'quickInput.last', primary: KeyCode.End, handler: focusHandler(QuickPickFocus.Last) },
{ withAltMod: true, withCtrlMod: true, withCmdMod: true }
{ id: 'quickInput.last', primary: ctrlKeyMod + KeyCode.End, handler: focusHandler(QuickPickFocus.Last) },
{ withAltMod: true, withCmdMod: true }
);
registerQuickPickCommandAndKeybindingRule(
{ id: 'quickInput.next', primary: KeyCode.DownArrow, handler: focusHandler(QuickPickFocus.Next) },
Expand Down

0 comments on commit b6298d8

Please sign in to comment.