Skip to content

feat(ui): page through tall hunks and add optional annotation stops - #407

Merged
umputun merged 2 commits into
masterfrom
hunk-step-full-coverage
Oct 22, 2026
Merged

umputun merged 2 commits into
masterfrom
hunk-step-full-coverage

Conversation

@umputun

@umputun umputun commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Implements the scope agreed in #405: ] and [ now page through hunks at least as tall as the viewport before moving on.

  • Tall hunks. On a hunk at least as tall as the viewport, ] scrolls through the rest of it a page at a time, keeping two rows of overlap, before moving to the next hunk. [ mirrors it: onto an earlier tall hunk it starts at the last page and pages up to the start. Shorter hunks keep today's jump, since ] already shows them whole when it moves onto them. On by default.
  • --stop-at-annotations (REVDIFF_STOP_AT_ANNOTATIONS, stop-at-annotations in the config, off by default). ] and [ also stop at the file-level annotation and at annotations on context lines, in file order with the hunk starts. Crossing files is still up to --cross-file-hunks, which stays a bool.
  • }/{ and the hunk counter are unchanged.

Tests cover visual-row coverage in both directions, wrapped annotations, collapsed mode, short-hunk jumps and cross-file boundaries. README, site/docs.html, the plugin references and the SKILL.md files document the flag.

Fixed #405

] on a hunk taller than the viewport jumped to the next hunk after showing
its first page, so the rest of it never reached the screen. ] and [ now
scroll through such a hunk a page at a time, keeping two rows of overlap,
before moving on, and [ onto an earlier tall hunk starts at its last page,
so stepping either way shows every row.

--stop-at-annotations (off by default) adds file-level and context-line
annotations to the same walk, in file order with the hunk starts.
--cross-file-hunks still controls crossing into other files.

Fixed #405
paging had no height check, so a short hunk left partly off screen by j,
a search jump or a click made ] scroll a couple of rows instead of moving
to the next hunk, and [ from an 18-line hunk centered by ] scrolled one row
instead of going to the previous stop. Paging now needs the hunk to be at
least as tall as the viewport, the same test [ uses when it moves onto an
earlier hunk; ] already shows any shorter hunk whole when it moves onto it.

buildHunkLayout derives line heights from the offsets instead of computing
each one twice. A new test pins that a page step which keeps the cursor on
the same line does not cross files, and the backlog item about the
delete-only guard points at its current locations.

Related to #405
Copilot AI balanced review requested due to automatic review settings October 22, 2026 17:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@umputun
umputun merged commit 106ef1c into master Oct 22, 2026
7 checks passed
@umputun
umputun deleted the hunk-step-full-coverage branch October 22, 2026 17:41
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.

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

2 participants