summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRasheed <[email protected]>2026-02-12 17:27:53 +0000
committerGitHub <[email protected]>2026-02-12 17:27:53 +0000
commit0771e3a8bee1b099468f3c95e19bd78699f62b12 (patch)
tree38ee8e49b24e3b24dda98b36529b32111b2f38c3
parentda952135cabba2926698298797cd301e7adaf48c (diff)
downloadopencode-0771e3a8bee1b099468f3c95e19bd78699f62b12.tar.gz
opencode-0771e3a8bee1b099468f3c95e19bd78699f62b12.zip
fix(app): preserve undo history for plain-text paste (#13351)
-rw-r--r--packages/app/src/components/prompt-input/attachments.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/app/src/components/prompt-input/attachments.ts b/packages/app/src/components/prompt-input/attachments.ts
index 232b7557d..9ea2e62a6 100644
--- a/packages/app/src/components/prompt-input/attachments.ts
+++ b/packages/app/src/components/prompt-input/attachments.ts
@@ -89,6 +89,9 @@ export function createPromptAttachments(input: PromptAttachmentsInput) {
}
if (!plainText) return
+ const inserted = typeof document.execCommand === "function" && document.execCommand("insertText", false, plainText)
+ if (inserted) return
+
input.addPart({ type: "text", content: plainText, start: 0, end: 0 })
}