Skip to content

fix(tui): read kill spans from the edit buffer before native deletes - #1465

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-10644-tui-adopt-textbuffer-textarea-input-natives
Oct 16, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-10644-tui-adopt-textbuffer-textarea-input-natives

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Kill-ring recording reads EditBuffer.getTextRange before native deletes instead of diffing the prompt.
  • The three line-budget clamps stay because TextBuffer truncate/wrapMode cannot preserve worker-wait degradation order, overlay line caps, or height wrapRanges.
  • The prompt stays a Textarea so Input.maxLength and virtual extmarks were not adopted.

Verification

  • src/tui/prompt-kill-ring.test.ts covers kill-ring recording from EditBuffer.getTextRange before native deletes.

Refs CL-10644

Native Textarea and Input deletes still discard the removed text. Record
the span with getTextRange on the cursor those deletes use, instead of
diffing the prompt value after the fact.
@linear-code

linear-code Bot commented Oct 16, 2026

Copy link
Copy Markdown

CL-10644

@corbits-triage

corbits-triage Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

deleteRange snaps or no-ops inside a wide cell, while a getTextRange
prediction still names the overlapping grapheme. The ring stores the
contiguous span the buffer actually lost, and the caret is parked where
that span splices back so yank restores it.

Refs CL-10644
The longest common prefix of a repeated span is the other copy, and
parking the caret there yanks into the wrong hole. Prefer the span the
native caret already sits on, and fall back to that prefix only when a
snapped wide cell left the caret on none of them.

Refs CL-10644
@TheGreatAxios
TheGreatAxios merged commit ddfdbc3 into main Oct 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant