diff options
| author | Dax Raad <[email protected]> | 2025-11-03 20:16:04 -0500 |
|---|---|---|
| committer | opencode <[email protected]> | 2025-11-04 04:01:22 +0000 |
| commit | af9a1797b52171ec625643e2d0116d77dfa9651b (patch) | |
| tree | 6584f24ccd4ddc3d26c8772d95bd0fc77b8de814 /packages | |
| parent | 29b3e40ddbdb803e3c712de8fa214589f7ab92f8 (diff) | |
| download | opencode-af9a1797b52171ec625643e2d0116d77dfa9651b.tar.gz opencode-af9a1797b52171ec625643e2d0116d77dfa9651b.zip | |
tui: use keybind helper for history navigation to respect custom keybindings
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx index 4078bf6fd..591fecc6b 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -587,8 +587,12 @@ export function Prompt(props: PromptProps) { return } - if (e.name === "up" && input.visualCursor.visualRow === 0) input.cursorOffset = 0 - if (e.name === "down" && input.visualCursor.visualRow === input.height - 1) + if (keybind.match("history_previous", e) && input.visualCursor.visualRow === 0) + input.cursorOffset = 0 + if ( + keybind.match("history_next", e) && + input.visualCursor.visualRow === input.height - 1 + ) input.cursorOffset = input.plainText.length } if (!autocomplete.visible) { @@ -712,7 +716,8 @@ export function Prompt(props: PromptProps) { <Match when={props.hint}>{props.hint!}</Match> <Match when={true}> <text fg={theme.text}> - {keybind.print("command_list")} <span style={{ fg: theme.textMuted }}>commands</span> + {keybind.print("command_list")}{" "} + <span style={{ fg: theme.textMuted }}>commands</span> </text> </Match> </Switch> |
