Skip to content

Commit f8c9ae7

Browse files
authored
Merge pull request microsoft#166461 from babakks/add-focus-breadcrumb-to-cmd-palette
🔨 Add "Focus Breadcrumb" to command palette
2 parents 10ae860 + f6c8436 commit f8c9ae7

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -549,28 +549,43 @@ registerAction2(class FocusAndSelectBreadcrumbs extends Action2 {
549549
super({
550550
id: 'breadcrumbs.focusAndSelect',
551551
title: {
552-
value: localize('cmd.focus', "Focus Breadcrumbs"),
553-
original: 'Focus Breadcrumbs'
552+
value: localize('cmd.focusAndSelect', "Focus and Select Breadcrumbs"),
553+
original: 'Focus and Select Breadcrumbs'
554554
},
555555
precondition: BreadcrumbsControl.CK_BreadcrumbsVisible,
556556
keybinding: {
557557
weight: KeybindingWeight.WorkbenchContrib,
558558
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Period,
559559
when: BreadcrumbsControl.CK_BreadcrumbsPossible,
560-
}
560+
},
561+
f1: true
561562
});
562563
}
563564
run(accessor: ServicesAccessor, ...args: any[]): void {
564565
focusAndSelectHandler(accessor, true);
565566
}
566567
});
567568

568-
KeybindingsRegistry.registerCommandAndKeybindingRule({
569-
id: 'breadcrumbs.focus',
570-
weight: KeybindingWeight.WorkbenchContrib,
571-
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Semicolon,
572-
when: BreadcrumbsControl.CK_BreadcrumbsPossible,
573-
handler: accessor => focusAndSelectHandler(accessor, false)
569+
registerAction2(class FocusBreadcrumbs extends Action2 {
570+
constructor() {
571+
super({
572+
id: 'breadcrumbs.focus',
573+
title: {
574+
value: localize('cmd.focus', "Focus Breadcrumbs"),
575+
original: 'Focus Breadcrumbs'
576+
},
577+
precondition: BreadcrumbsControl.CK_BreadcrumbsVisible,
578+
keybinding: {
579+
weight: KeybindingWeight.WorkbenchContrib,
580+
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Semicolon,
581+
when: BreadcrumbsControl.CK_BreadcrumbsPossible,
582+
},
583+
f1: true
584+
});
585+
}
586+
run(accessor: ServicesAccessor, ...args: any[]): void {
587+
focusAndSelectHandler(accessor, false);
588+
}
574589
});
575590

576591
// this commands is only enabled when breadcrumbs are

0 commit comments

Comments
 (0)