From dd6648bc49f771f50b5f11c47ec67bb6b5551083 Mon Sep 17 00:00:00 2001 From: Sebastian Herrlinger Date: Tue, 28 Oct 2025 22:23:29 +0100 Subject: [PATCH] threshold for collapsing pasted text --- .../src/cli/cmd/tui/component/prompt/index.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 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 12f054683..d876a1ad7 100644 --- a/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx @@ -503,12 +503,16 @@ export function Prompt(props: PromptProps) { event.preventDefault() return } - event.preventDefault() const pastedContent = event.text.trim() - if (!pastedContent) return - const lineCount = (pastedContent.match(/\n/g)?.length ?? 0) + 1 + + if (lineCount <= 5) { + return + } + + event.preventDefault() + const currentOffset = input.visualCursor.offset const virtualText = `[Pasted ~${lineCount} lines]` const textToInsert = virtualText + " "