Skip to main content

format

Function format 

Source
pub fn format(keystrokes: &[KeybindingKeystroke]) -> SharedString
Expand description

Format a binding’s keystrokes the way the platform writes them.

macOS gets the glyphs in the order Apple sets them — ⌃⌥⇧⌘, modifiers before the key, nothing between — and every other platform gets Ctrl+Shift+P, with the platform key leading: Win+Shift+S. A two-keystroke chord is the two spelled out with a space between, which is how both platforms print a sequence.

Written here rather than taken from gpui’s Display because that one orders before and leaves enter, delete and space spelled as words in among the glyphs.