fix(opencode): update pasteImage to only increment count when the previous attachment is an image too (#14173)
This commit is contained in:
parent
72c12d59af
commit
be2e6f1926
1 changed files with 1 additions and 1 deletions
|
|
@ -694,7 +694,7 @@ export function Prompt(props: PromptProps) {
|
||||||
async function pasteImage(file: { filename?: string; content: string; mime: string }) {
|
async function pasteImage(file: { filename?: string; content: string; mime: string }) {
|
||||||
const currentOffset = input.visualCursor.offset
|
const currentOffset = input.visualCursor.offset
|
||||||
const extmarkStart = currentOffset
|
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 virtualText = `[Image ${count + 1}]`
|
||||||
const extmarkEnd = extmarkStart + virtualText.length
|
const extmarkEnd = extmarkStart + virtualText.length
|
||||||
const textToInsert = virtualText + " "
|
const textToInsert = virtualText + " "
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue