Repository navigation
Name selection writes instead of inferring a selection's identity - #1323
Merged
Merged
Conversation
setSelection now says whether a write replaces, edits, or follows the selection: only a replace starts a new one for a pending copy, and only a follow keeps the program's offer. A counter bumped on clear or replace stands in for the inferred identity object, so beginDrag no longer special-cases it. The trim follow reuses the markers that already moved with the content instead of rebuilding the baseline and every marker on each shifted render. The scroll marker drops its redundant row, and markRow shares the cursor-relative marker math with the reflow anchor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dormouse-bot
approved these changes
Oct 21, 2026
nedtwigg
had a problem deploying
to
hosted-preview
October 21, 2026 15:59 — with
GitHub Actions
Error
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A cleanup pass over #1280 and #1281.
setSelectionused to work out whether a write was the same selection from its null-ness, plus apreserveProgramCopyflag. It now takes a write kind:replace,edit(a nudge), orfollow(scroll, trim, or reflow).beginDragno longer sets identity itself.When older scrollback is trimmed,
watchSelectionnow follows the selection without re-reading its baseline or disposing and re-registering markers on every shifted render. The markers have already moved with the content, so this saves that work while output streams into a full buffer.markRowputs the cursor-relative marker offset in one place, shared with the reflow anchor.Tests:
COPY_FLASH_MSinstead of a hard-coded 1500.Not changed:
anchorSelection. That would mean runningfollowReflow's line walks on every render, and the two answer different questions.vi.Validation: lib
tsc -b, standalonetsc --noEmit, spec and Markdown lints, and the lib suite pass. The one exception isrelay-origin.test.ts, which needs a builtremote-lib-commonin a fresh worktree and fails the same way on #1281's branch.🤖 Generated with Claude Code