summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-10-31 20:10:01 -0400
committerDax Raad <[email protected]>2025-10-31 20:10:01 -0400
commit5565f14ef5f62701c84eaba264245168e6f63bd0 (patch)
treec3bd599dbc7ab384a50bf00858bb13d1ec6f9dd6
parent10a4455c6fd231dab58ce59fe59c747e3f7105b0 (diff)
downloadopencode-5565f14ef5f62701c84eaba264245168e6f63bd0.tar.gz
opencode-5565f14ef5f62701c84eaba264245168e6f63bd0.zip
tab to accept autocomplete
-rw-r--r--packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx5
-rw-r--r--packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx2
2 files changed, 7 insertions, 0 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx
index ce9bcde42..4b648e9d9 100644
--- a/packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx
@@ -28,7 +28,9 @@ function init() {
return registrations().flatMap((x) => x())
})
+ let keybinds = true
useKeyboard((evt) => {
+ if (!keybinds) return
for (const option of options()) {
if (option.keybind && keybind.match(option.keybind, evt)) {
evt.preventDefault()
@@ -47,6 +49,9 @@ function init() {
}
}
},
+ keybinds(enabled: boolean) {
+ keybinds = enabled
+ },
show() {
dialog.replace(() => <DialogCommand options={options()} />)
},
diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx
index e455f99bd..4f97d7885 100644
--- a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx
@@ -321,6 +321,7 @@ export function Autocomplete(props: {
}
function show(mode: "@" | "/") {
+ command.keybinds(false)
setStore({
visible: mode,
index: props.input().visualCursor.offset,
@@ -338,6 +339,7 @@ export function Autocomplete(props: {
const cursor = props.input().logicalCursor
props.input().deleteRange(0, 0, cursor.row, cursor.col)
}
+ command.keybinds(true)
setStore("visible", false)
}