chore: generate
This commit is contained in:
@@ -46,7 +46,12 @@ const inputCommands = {
|
||||
input_select_all: "input.select.all",
|
||||
} as const satisfies Partial<Record<keyof LegacyKeybinds, string>>
|
||||
|
||||
function add(config: SectionsConfig, section: KeymapSection, command: string, binding: BindingValue<Renderable, KeyEvent> | undefined) {
|
||||
function add(
|
||||
config: SectionsConfig,
|
||||
section: KeymapSection,
|
||||
command: string,
|
||||
binding: BindingValue<Renderable, KeyEvent> | undefined,
|
||||
) {
|
||||
if (binding === undefined) return
|
||||
config[section] ??= {}
|
||||
config[section][command] = binding
|
||||
@@ -154,7 +159,12 @@ export function create(keybinds: LegacyKeybinds): KeymapConfigInput {
|
||||
add(config, "dialog_select", "dialog.select.submit", keybinds["dialog.select.submit"])
|
||||
add(config, "dialog_actions", "dialog.action.delete", combineBindings(keybinds.stash_delete, keybinds.session_delete))
|
||||
add(config, "dialog_actions", "dialog.action.rename", keybinds.session_rename)
|
||||
add(config, "dialog_actions", "dialog.action.toggle", combineBindings(keybinds["dialog.mcp.toggle"], keybinds["plugins.toggle"]))
|
||||
add(
|
||||
config,
|
||||
"dialog_actions",
|
||||
"dialog.action.toggle",
|
||||
combineBindings(keybinds["dialog.mcp.toggle"], keybinds["plugins.toggle"]),
|
||||
)
|
||||
add(config, "model", "model.dialog.provider", keybinds.model_provider_list)
|
||||
add(config, "model", "model.dialog.favorite", keybinds.model_favorite_toggle)
|
||||
|
||||
|
||||
@@ -293,7 +293,12 @@ export function keymapBindingDefaults(input: { section: string; binding: Readonl
|
||||
export const KeymapConfig = z
|
||||
.object({
|
||||
leader: z.string().prefault("ctrl+x"),
|
||||
leader_timeout: z.number().int().positive().prefault(KeymapLeaderTimeoutDefault).describe("Leader key timeout in milliseconds"),
|
||||
leader_timeout: z
|
||||
.number()
|
||||
.int()
|
||||
.positive()
|
||||
.prefault(KeymapLeaderTimeoutDefault)
|
||||
.describe("Leader key timeout in milliseconds"),
|
||||
sections: KeymapSections,
|
||||
})
|
||||
.strict()
|
||||
|
||||
@@ -23,12 +23,7 @@ import * as Log from "@opencode-ai/core/util/log"
|
||||
import { ConfigVariable } from "@/config/variable"
|
||||
import { Npm } from "@opencode-ai/core/npm"
|
||||
import { LegacyKeymapTransform } from "./legacy-keymap-transform"
|
||||
import {
|
||||
KeymapSectionNames,
|
||||
keymapBindingDefaults,
|
||||
type KeymapInfo,
|
||||
type KeymapSection,
|
||||
} from "./tui-schema"
|
||||
import { KeymapSectionNames, keymapBindingDefaults, type KeymapInfo, type KeymapSection } from "./tui-schema"
|
||||
|
||||
const log = Log.create({ service: "tui.config" })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user