Skip to content

Commit

Permalink
Fix MacOS browser menu keybinding display (#11092)
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-grant-work authored May 2, 2022
1 parent 9c06e3d commit 08722fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/browser/keybinding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ export class KeybindingRegistry {
* @param keybinding the keybinding
* @param separator the separator to be used to stringify {@link KeyCode}s that are part of the {@link KeySequence}
*/
acceleratorFor(keybinding: common.Keybinding, separator: string = ' '): string[] {
acceleratorFor(keybinding: common.Keybinding, separator: string = ' ', asciiOnly = false): string[] {
const bindingKeySequence = this.resolveKeybinding(keybinding);
return this.acceleratorForSequence(bindingKeySequence, separator);
return this.acceleratorForSequence(bindingKeySequence, separator, asciiOnly);
}

/**
Expand All @@ -325,8 +325,8 @@ export class KeybindingRegistry {
* @param keySequence the keysequence
* @param separator the separator to be used to stringify {@link KeyCode}s that are part of the {@link KeySequence}
*/
acceleratorForSequence(keySequence: KeySequence, separator: string = ' '): string[] {
return keySequence.map(keyCode => this.acceleratorForKeyCode(keyCode, separator));
acceleratorForSequence(keySequence: KeySequence, separator: string = ' ', asciiOnly = false): string[] {
return keySequence.map(keyCode => this.acceleratorForKeyCode(keyCode, separator, asciiOnly));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/browser/menu/browser-menu-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ export class MenuCommandRegistry extends PhosphorCommandRegistry {
// Only consider the first keybinding.
if (bindings.length) {
const binding = bindings[0];
const keys = keybindingRegistry.acceleratorFor(binding);
const keys = keybindingRegistry.acceleratorFor(binding, ' ', true);
this.addKeyBinding({
command: id,
keys,
Expand Down

0 comments on commit 08722fa

Please sign in to comment.