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