opencode
opencode copied to clipboard
Fix: TUI single-line paste cursor position
Fix: TUI single-line paste cursor position
Description
This PR fixes a bug where pasting single-line text in the TUI prompt would incorrectly move the cursor to the end of the input buffer, instead of placing it immediately after the pasted text.
Issue
Fixes #7210
Changes
- Removed
input.gotoBufferEnd()from theonPastehandler inopencode/packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx.
Verification
- Verified that
input.gotoBufferEnd()was the cause of the cursor jump. - The default behavior of the textarea component handles cursor positioning correctly for pasted text.
- Retained
markDirty()andrequestRender()to ensure UI updates correctly after paste.