summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorOpeOginni <[email protected]>2026-02-18 19:09:09 +0100
committerGitHub <[email protected]>2026-02-18 12:09:09 -0600
commitbe2e6f1926176dadb5a5cf12d5790189a6a5bb50 (patch)
treec7bce60cec7f4ff31519b0c8cf240fb45439019a /packages
parent72c12d59afca7092dc98842b094305d385cf7863 (diff)
downloadopencode-be2e6f1926176dadb5a5cf12d5790189a6a5bb50.tar.gz
opencode-be2e6f1926176dadb5a5cf12d5790189a6a5bb50.zip
fix(opencode): update pasteImage to only increment count when the previous attachment is an image too (#14173)
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx2
1 files changed, 1 insertions, 1 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 cefef208d..4114daf6c 100644
--- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
+++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx
@@ -694,7 +694,7 @@ export function Prompt(props: PromptProps) {
async function pasteImage(file: { filename?: string; content: string; mime: string }) {
const currentOffset = input.visualCursor.offset
const extmarkStart = currentOffset
- const count = store.prompt.parts.filter((x) => x.type === "file").length
+ const count = store.prompt.parts.filter((x) => x.type === "file" && x.mime.startsWith("image/")).length
const virtualText = `[Image ${count + 1}]`
const extmarkEnd = extmarkStart + virtualText.length
const textToInsert = virtualText + " "