| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | | import type { KeybindingCommand, KeybindingsConfig } from "@t3tools/contracts"; |
| 1 | import type { KeybindingCommand, KeybindingRule, KeybindingsConfig } from "@t3tools/contracts"; |
| 2 | 2 | |
| 3 | 3 | export interface ShortcutEventLike { |
| 4 | 4 | key: string; |
| ... | ... | @@ -14,13 +14,8 @@ export interface ShortcutMatchContext { |
| 14 | 14 | [key: string]: boolean; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | | export interface ResolvedTerminalKeybinding { |
| 18 | | key: string; |
| 19 | | command: KeybindingCommand; |
| 20 | | when?: string | undefined; |
| 21 | | } |
| 22 | | |
| 23 | | export type ResolvedTerminalKeybindings = ResolvedTerminalKeybinding[]; |
| 17 | export type ResolvedTerminalKeybinding = KeybindingRule; |
| 18 | export type ResolvedTerminalKeybindings = KeybindingsConfig; |
| 24 | 19 | |
| 25 | 20 | export const DEFAULT_TERMINAL_KEYBINDINGS: ResolvedTerminalKeybindings = [ |
| 26 | 21 | { key: "mod+j", command: "terminal.toggle" }, |
| ... | ... | @@ -312,7 +307,7 @@ function resolveContext(options: ShortcutMatchOptions | undefined): ShortcutMatc |
| 312 | 307 | } |
| 313 | 308 | |
| 314 | 309 | function normalizeConfiguredKeybinding( |
| 315 | | keybinding: KeybindingsConfig[number], |
| 310 | keybinding: KeybindingRule, |
| 316 | 311 | ): ResolvedTerminalKeybinding | null { |
| 317 | 312 | const key = keybinding.key.trim(); |
| 318 | 313 | if (key.length === 0) return null; |