Repository navigation
surface: a selection covers every cell it sweeps, code spans included (#294) - #296
santoshkumarradha wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B25XERftiFQW619ctN4kRg
…#294) A ground step was one background code, the text, and one reset — true only of text that carries no background of its own. An inline code span carries one, and it closes with the compound `\x1b[49;39m`: nested inside a selection, the set turned the span into a hole the highlight skipped, and the clear switched the ground off for the whole rest of the row. A sweep over a line that opened with a backticked path lit four cells of sixty-four and read as a selection that had not happened. `palette.background` now rewrites every background parameter inside the span it wraps to its own ground — an inner set, an inner clear, and a full reset, in every form the styler can emit. Inks and attributes are left alone, so a marked code span keeps its colour, its bold and its italic; only the plane under it is made one. THE SELECTION WINS OVER THE CHIP, which is the ruling and not a side effect: the mark is the loudest rung of the ground ladder, and every terminal's own selection replaces the background it sweeps over. The clipboard was always right — the yank reads stripped text — so this was the paint lying about a copy that was correct, which is the whole damage: the paint is all a person has to tell them what they are about to take. The same step draws copy mode's span, the pointer's row on every list that carries chips, and pastechip's marked token, so all of them come back with it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B25XERftiFQW619ctN4kRg
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B25XERftiFQW619ctN4kRg
`internal/manual/chat.pack.gz` is tracked, so a page edited without a repack is a page the shipped binary has not learned — and the `check` job says so. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B25XERftiFQW619ctN4kRg
4ae431a to
20d6a5f
Compare
|
Superseded by #303, which fixes the same root cause correctly where this branch does not. Both branches rewrite inner background parameters in #303 also already carries every test named in #294's acceptance, under the same names, including the two end-to-end ones through Closing unmerged; nothing here is worth carrying over. Issue #294 stays open for #303. |
Closes #294.
What was wrong
A ground step —
palette.mark,palette.selected,palette.cursor— was onebackground code, the text, and one reset. That is only true of text carrying no
background of its own, and the transcript is full of text that does: an inline
code span sits on the surface's raised plane, and it both sets a ground and
clears it on the way out with the compound
\x1b[49;39m.Nested inside a selection, the set turned the span into a hole the highlight
visibly skipped, and the clear — the worse of the two — switched the ground off
for the whole rest of the row. Measured at the door, off the bytes
a.frame()hands the terminal:
The internal/swepro/ directory was deleted, along with the rest.ctrl+s) over a row with one spanThe clipboard was always right —
dragYankreadsansi.Stripped text — so thiswas the paint lying about a copy that was correct. That is the whole damage: the
paint is all a person has to tell them what they are about to take, and
keys.mdpromised them "What is highlighted is exactly what is copied, to thecharacter."
The change
palette.backgroundrewrites every background parameter inside the span itwraps to its own ground: an inner set becomes the step's ground, an inner clear
becomes the step's ground, and a full reset keeps its reset and re-lays the
ground behind it. Every form the styler can emit is answered —
48;5;n,48;2;r;g;b, the sixteen-colour40–47and100–107, the bare49, thecompound
49;39prose actually emits, and0spelled as no parameters at all.Inks and attributes are untouched, so a marked code span keeps its colour, its
bold and its italic; only the plane under it is made one.
THE SELECTION WINS OVER THE CHIP, and that is the ruling rather than an
accident of implementation. The mark is the loudest rung of the ground ladder; a
raised plane inside it says "this cell is a different kind of thing" at exactly
the moment the person is being told "these cells are the ones". Every terminal's
own selection replaces the background it sweeps over, and this one now reads the
same.
Because it lands on the shared step, everything drawn with it comes back at
once: the sweep, copy mode's span, the pointer's row on every list carrying
chips or code spans (memory, spend, search, rewind, task, crew, effortchip), and
pastechip'smark(chip(token)), which nested the two outright.Text with no escape in it returns untouched and unallocated, which is most of
what this is handed.
Tests
internal/tui3/holdground_test.go, new:TestASweepOverACodeSpanLightsEveryCellItCopies— drives a real pressand sweep through
app.Update, reads the row back out ofa.frame(), andasserts every cell wears the selection's ground, padding included.
TestTheSweepCopiesExactlyWhatItLit— the control: releases the samesweep and asserts the OSC 52 payload, so a future change cannot make the
highlight honest by making the copy wrong.
TestAGroundStepCoversEveryCellItIsGiven—markandselected, atTrueColor and ANSI256, over five row shapes to full coverage.
TestRegroundAnswersEveryBackgroundForm— every SGR form above.TestHoldGroundLeavesPlainTextAlone,TestAGroundStepLeavesTheInkAlone,TestAGroundStepPaintsItsPaddingToo— the things that must NOT change.The cell counter (
litCells) walks SGR the way a terminal does, because thesequence at fault is compound and a naive scan for
\x1b[49mnever sees it —which is why this survived review the first time.
Full
internal/tui3suite green, so no snapshot asserting the old escape streambroke.
Manual
internal/manual/chat/keys.mdgains "The highlight covers inline code too."under Selecting text with your mouse, stating the ruling in the person's own
words.
🤖 Generated with Claude Code
https://claude.ai/code/session_01B25XERftiFQW619ctN4kRg