Skip to content

Stepping through a review with ] can pass content that never reached the screen #405

Closed

Description

@chris-peterson

Context

I lean heavily on ] to step through a review, with this in ~/.config/revdiff/config:

cross-file-hunks = true

The 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 plugin references/usage.md copies cover whichever shape lands.

Activity

  1. umputun commented on Oct 22, 2026

    @umputun
    Owner

    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
    • one opt-in bool that makes ] / [ also stop at annotations outside hunks, file-level ones included

    no new actions, and cross-file-hunks stays a bool. Does that cover the way you step through a review?

  2. umputun commented on Oct 22, 2026

    @umputun
    Owner

    the crossing part is fixed in #406. With cross-file-hunks on, ] 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.

  3. chris-peterson commented on Oct 22, 2026

    @chris-peterson
    ContributorAuthor

    RE: #405 (comment)
    yes; that sounds great; thanks for the quick response(s)!

  4. added a commit that references this issue on Oct 22, 2026
    106ef1c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions