The open source coding agent.
TypeScript
fix undo command breaking other commands
Dax Raadf636d937c4d0
diff --git a/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx b/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsxindex f40d40360dd..88ca324207f 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().logicalCursorprops.input().deleteRange(0, 0, cursor.row, cursor.col)}