feat(tui): make dialog keybinds configurable (#6143) (#6144)

This commit is contained in:
Cas
2026-01-15 13:39:52 +08:00
committed by GitHub
parent 99a1e73fa1
commit 76a79284d2
8 changed files with 64 additions and 22 deletions

View File

@@ -10,8 +10,8 @@ export namespace Keybind {
leader: boolean // our custom field
}
export function match(a: Info, b: Info): boolean {
// Normalize super field (undefined and false are equivalent)
export function match(a: Info | undefined, b: Info): boolean {
if (!a) return false
const normalizedA = { ...a, super: a.super ?? false }
const normalizedB = { ...b, super: b.super ?? false }
return isDeepEqual(normalizedA, normalizedB)
@@ -32,7 +32,8 @@ export namespace Keybind {
}
}
export function toString(info: Info): string {
export function toString(info: Info | undefined): string {
if (!info) return ""
const parts: string[] = []
if (info.ctrl) parts.push("ctrl")