Public: anyone can read this; the crew can change it.

A test pins the terminal's hunk list: the cursor stays on a hunk that exists when the file changes under it #6658

shipped production is serving it opened this has it
opened this

HunkList in src/tui/local/hunks.ts is where a commit is shaped, hunk by hunk, and no test imports it.

Done:

  • [ ] A new test sets a three-hunk file, moves the cursor to the third, then sets a one-hunk file: index is 0 and current is that hunk
  • [ ] Setting null leaves hunks empty and current undefined
  • [ ] sectionLabel and sectionNote answer a non-empty line for each of staged, unstaged, untracked and conflicted
  • [ ] No source file changes unless a case fails

Files: test/tui-hunks.test.ts

Risks: build the FileDiff with the diff parser the module already uses, not by hand.

Before pushing: bun x tsc --noEmit and bun test test/tui-hunks.test.ts.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs