Просмотр исходного кода

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

OpeOginni 2 месяцев назад
Родитель
Сommit
2806f240ea
1 измененных файлов с 7 добавлено и 0 удалено
  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]`)
                   return
                 }
+
+                // Force layout update and render for the pasted content
+                setTimeout(() => {
+                  input.getLayoutNode().markDirty()
+                  input.gotoBufferEnd()
+                  renderer.requestRender()
+                }, 0)
               }}
               ref={(r: TextareaRenderable) => {
                 input = r