Skip to content

Commit 486205f

Browse files
committed
fix(tui): fix Editor.open Result type handling and add onSearchToggle prop
Upstream v1.0.223 changed Editor.open to return Result type but didn't update all call sites. Also adds missing onSearchToggle prop to PromptProps.
1 parent e67716a commit 486205f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • packages/opencode/src/cli/cmd/tui/component/prompt

packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export type PromptProps = {
3535
sessionID?: string
3636
disabled?: boolean
3737
onSubmit?: () => void
38+
onSearchToggle?: () => void
3839
ref?: (ref: PromptRef) => void
3940
hint?: JSX.Element
4041
showPlaceholder?: boolean
@@ -304,9 +305,10 @@ export function Prompt(props: PromptProps) {
304305
const nonTextParts = store.prompt.parts.filter((p) => p.type !== "text")
305306

306307
const value = trigger === "prompt" ? "" : text
307-
const content = await Editor.open({ value, renderer })
308-
if (!content) return
308+
const result = await Editor.open({ value, renderer })
309+
if (!result.ok) return
309310

311+
const content = result.content
310312
input.setText(content)
311313

312314
// Update positions for nonTextParts based on their location in new content

0 commit comments

Comments
 (0)