Skip to content

Add issue #121's ICH repro as a regression test - #122

Merged
JohnCampionJr merged 1 commit into
tomlm:mainfrom
JohnCampionJr:test/ich-midline-regression
Aug 31, 2026
Merged

JohnCampionJr merged 1 commit into
tomlm:mainfrom
JohnCampionJr:test/ich-midline-regression

Conversation

@JohnCampionJr

Copy link
Copy Markdown
Collaborator

#121 reported the classic mid-line ICH smear (an overlapping forward copy replicating the cell under the cursor to the end of the row). It does not reproduce on current main — the fix landed in #80, which gave CopyCellsFrom memmove semantics (

public void CopyCellsFrom(BufferLine src, int srcCol, int destCol, int length, bool applyInReverse)
{
// Memmove semantics, decided HERE rather than trusted to the caller: copying within one
// line with the destination ahead of the source re-reads cells it has already written
// when it walks forward, and the shifted region degenerates into the first cell repeated
// -- which is exactly what a mid-line insert looked like on screen (type into the middle
// of a bash command line and the tail becomes one letter, over and over). Every caller
// that shifts right within a line is safe now whatever it passes.
if (ReferenceEquals(src, this) && destCol > srcCol && destCol < srcCol + length)
applyInReverse = true;
) — and the published 2.0.0-rc005 binary passes the issue's repro too.

This just pins the issue's exact shape down with a named test: the cursor arrives mid-line by backspaces rather than CUP, and the gap can be wider than one cell. The count > 1 case exercises the overlap test inside CopyCellsFrom with a shift distance the existing count-1 regression tests from #80 never reach.

Full suite green: 2,114 passed.

Closes #121.

🤖 Generated with Claude Code

The mid-line smear was already fixed by tomlm#80's memmove guard inside
CopyCellsFrom, but the issue's exact shape -- cursor placed by
backspaces, and a gap wider than one cell -- had no named test. The
count > 1 case exercises the overlap test with a shift distance the
existing count-1 tests never reach.

Closes tomlm#121.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@JohnCampionJr
JohnCampionJr force-pushed the test/ich-midline-regression branch from a0563c6 to b9d5210 Compare August 31, 2026 15:32
@JohnCampionJr
JohnCampionJr merged commit fdeac61 into tomlm:main Aug 31, 2026
4 checks passed
@JohnCampionJr
JohnCampionJr deleted the test/ich-midline-regression branch August 31, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InsertChars (CSI Ps @) copies the row forwards over itself, repeating the cell at the cursor

1 participant