Pin the touched reset on the editor an advance reopens (improvise-465t)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VdfEGXA7aJ6ftMsCc9PJze
This commit is contained in:
Edward Langley
2026-09-23 08:20:36 -07:00
parent c6c2de96b2
commit 0051e57341
4 changed files with 71 additions and 0 deletions
+15
View File
@@ -5827,3 +5827,18 @@ editor's seed.
This test is only possible because `clear-buffer` and keys typed into another
buffer do not mark the editor. A rule that marked on every buffer write would
make the guard redundant, and no test could pin it (`protocol.md` §3).
### `command::cmd::commit::tests::the_editor_an_advance_reopens_starts_untouched`
**improvise-465t**, found by the #205 re-review. Every open resets `touched`,
but no test pinned the reset on the editor that `CommitAndAdvance` reopens
through `EnterEditAtCursor`. The test works on the 2×2 pivot. It presses `i`
on (West, Cost), row 1 and column 0, types `9`, and asserts the first editor
really is touched. Then it presses Enter. The cursor must land on (0, 1), and
the reopened editor must be exactly `OpenedEditor::on("2")`, which means seeded
from the landed cell and untouched.
**Injection:** `EnterEditAtCursor` carrying the previous editor's `touched`
flag. This test fails alone. Every other test stays green, which was the gap.
Once improvise-fy9o re-seeds the reopened editor, a stale `touched` would make
every untouched Tab or Enter write its seed.