( action: string, context: KeybindingContextName, bindings: ParsedBinding[], )
| 65 | * Searches in reverse order so user overrides take precedence. |
| 66 | */ |
| 67 | export function getBindingDisplayText( |
| 68 | action: string, |
| 69 | context: KeybindingContextName, |
| 70 | bindings: ParsedBinding[], |
| 71 | ): string | undefined { |
| 72 | // Find the last binding for this action in this context |
| 73 | const binding = bindings.findLast( |
| 74 | b => b.action === action && b.context === context, |
| 75 | ) |
| 76 | return binding ? chordToString(binding.chord) : undefined |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Build a ParsedKeystroke from Ink's input/key. |
no test coverage detected