Skip to content

Commit be2e6f1

Browse files
authored
fix(opencode): update pasteImage to only increment count when the previous attachment is an image too (#14173)
1 parent 72c12d5 commit be2e6f1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ export function Prompt(props: PromptProps) {
694694
async function pasteImage(file: { filename?: string; content: string; mime: string }) {
695695
const currentOffset = input.visualCursor.offset
696696
const extmarkStart = currentOffset
697-
const count = store.prompt.parts.filter((x) => x.type === "file").length
697+
const count = store.prompt.parts.filter((x) => x.type === "file" && x.mime.startsWith("image/")).length
698698
const virtualText = `[Image ${count + 1}]`
699699
const extmarkEnd = extmarkStart + virtualText.length
700700
const textToInsert = virtualText + " "

0 commit comments

Comments
 (0)