Browse Source

fix: resize textarea when pasting prompt less than 150 chars (#6070)

OpeOginni 2 months ago
parent
commit
2806f240ea
1 changed files with 7 additions and 0 deletions
  1. 7 0
      packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

+ 7 - 0
packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

@@ -930,6 +930,13 @@ export function Prompt(props: PromptProps) {
                   pasteText(pastedContent, `[Pasted ~${lineCount} lines]`)
                   pasteText(pastedContent, `[Pasted ~${lineCount} lines]`)
                   return
                   return
                 }
                 }
+
+                // Force layout update and render for the pasted content
+                setTimeout(() => {
+                  input.getLayoutNode().markDirty()
+                  input.gotoBufferEnd()
+                  renderer.requestRender()
+                }, 0)
               }}
               }}
               ref={(r: TextareaRenderable) => {
               ref={(r: TextareaRenderable) => {
                 input = r
                 input = r