Repository navigation
Description
Context
I lean heavily on ] to step through a review, with this in ~/.config/revdiff/config:
cross-file-hunks = trueThe problem is that ] can move past content that never reached the screen:
- A hunk taller than the viewport lands with its first line near the top. The next
]goes to the following hunk, so the rest of the tall one is never shown. - Annotations outside a hunk get skipped: file-level ones, ones on context lines, and ones above the first hunk of a file
]crosses into.
So when I reach the last hunk, I can't tell whether I've seen everything. Today I check with a second pass on } or by opening @.
Options
Is this worth solving, and if so, how would you approach it? Here are the shapes I can see, in case they help.
A. Separate next_step / prev_step actions
A new pair of actions that steps through hunk starts and annotations, in file order, across files. ], [, }, { stay as they are.
The default keys would be s / S, both unbound, following the n / N pattern for forward and back. Anyone who wants to step with ] rebinds it in ~/.config/revdiff/keybindings:
map ] next_step
map [ prev_step
Pros: existing keys keep their meaning; no new option.
Cons: two more actions that overlap ] and }; a third file-crossing landing intent next to pendingHunkJump and pendingAnnotJump.
B. Configurable stops for ] / [
Turn cross-file-hunks into a list of what ] / [ do, the same way include / exclude take a list. Working name step, since the key is no longer stepping through hunks alone:
step = cross-file,annotations| Value | ] / [ also |
|---|---|
cross-file |
crosses file boundaries (today's cross-file-hunks = true) |
annotations |
stops at annotations outside hunks, including file-level ones |
cross-file-hunks = true would keep working as step = cross-file.
Pros: no new keys; one setting for anyone who already steps with ].
Cons: ] means different things depending on config; a bool option migrates to a list.
Tall hunks
The tall-hunk case is a separate but related concern, and neither shape above covers it. It reads more like a viewport setting next to wrap than a stop type: working name show-more, where ] on a hunk taller than the viewport scrolls through the rest of it before moving to the next one.
Acceptance criteria
- Existing behavior is unchanged by default; any change to how
],[,},{behave is opt-in. - One key steps a review through every hunk and every annotation, crossing files.
- Past the last step (or before the first), the key does nothing, as
]/[do today at the last / first hunk. - README,
site/docs.html, and the pluginreferences/usage.mdcopies cover whichever shape lands.
Activity
umputun commentedon Oct 22, 2026
the tall-hunk part is real.
]puts the first line of a hunk taller than the viewport near the top (#83), and the next]goes to the following hunk, so the rest of it is never drawn. Crossing into another file can also show less of the hunk than an in-file jump. I'm fixing that separately.for annotations,
}/{already step across files and support file-level and context-line annotations. What's missing is one pass that covers hunks and annotations together.I'd rather not take either shape as proposed. A adds two actions that overlap
]and}, plus one more kind of pending jump to the next file, on top of the three that already have to stay correct. B turns an existing bool into a list, and]would mean different things depending on config. The narrower version I'd consider:]/[on a hunk taller than the viewport scroll through the rest of it before moving to the next hunk]/[also stop at annotations outside hunks, file-level ones includedno new actions, and
cross-file-hunksstays a bool. Does that cover the way you step through a review?fix(ui): keep hunk framing when ] or [ crosses into another file
umputun commentedon Oct 22, 2026
the crossing part is fixed in #406. With
cross-file-hunkson,]and[into another file now show the hunk the same way a jump within the file does. The tall-hunk and annotation stepping parts are still open, as in the comment above.chris-peterson commentedon Oct 22, 2026
RE: #405 (comment)
yes; that sounds great; thanks for the quick response(s)!
feat(ui): page through tall hunks and add optional annotation stops (#…