summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-11-06 11:25:37 -0500
committerDax Raad <[email protected]>2025-11-06 11:25:37 -0500
commitf636d937c4d01fdbcf77d82664489933eca80ac4 (patch)
treeea67a1b31a610bfbff323a8c233c67e6b76877d5
parent492bf51a0dfa4fd278337b6e75da807048d44ff1 (diff)
downloadopencode-f636d937c4d01fdbcf77d82664489933eca80ac4.tar.gz
opencode-f636d937c4d01fdbcf77d82664489933eca80ac4.zip
fix undo command breaking other commands
-rw-r--r--packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx3
1 files changed, 1 insertions, 2 deletions
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 f40d40360..88ca32420 100644
--- a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx
@@ -210,7 +210,6 @@ export function Autocomplete(props: {
display: "/undo",
description: "undo the last message",
onSelect: () => {
- hide()
command.trigger("session.undo")
},
},
@@ -374,7 +373,7 @@ export function Autocomplete(props: {
function hide() {
const text = props.input().plainText
- if (store.visible === "/" && !text.endsWith(" ")) {
+ if (store.visible === "/" && !text.endsWith(" ") && text.startsWith("/")) {
const cursor = props.input().logicalCursor
props.input().deleteRange(0, 0, cursor.row, cursor.col)
}