feat: ]] and [[ move by step #28

Merged
barrettruth merged 1 commit from feat/step-motions into main 2026-07-28 00:05:47 +00:00
Owner

Checklist

  • I have read CONTRIBUTING.md.
  • No AI was used to generate, edit, or review any part of this contribution.

Problem

I claimed fold motions already covered this. They do not — nothing native
selects a fold level
, and a group is a fold just as much as a step is:

zj   -> 3 ##[group]Runner Image P | 10 ##[group]Operating Syst | 14 ##[group]Runner Image
]z   -> 29 Download action reposit | 29 (same) | 29 (same)
3zj  -> 14 ##[group]Runner Image | 32 ##[group]Run actions/ch | 58 ##[group]Initializing t

zj lands on four groups before reaching the second step. ]z only finds the
end of the fold you are already in. A count on zj counts folds of any level,
so 3zj is wherever three groups happen to fall.

zM then j does walk steps — the answer I gave — but only by collapsing the
buffer, which throws away the view you were reading.

Solution

]]   -> 30 ✓ Run actions/che | 130 ✓ Run ./.github/a | 311 ✓ Initialize Code | 1181 ✓ Run make
2]]  -> 130 ✓ Run ./.github/a | 1181 ✓ Run make
[[ from 1200 -> 1181
jumplist ok, '' -> 1200

Count-aware, and it sets '' so <C-o> brings you back. The level is read
from the fold data already computed for foldexpr rather than from a search,
so it cannot disagree with the folds.

guh.nvim maps the same pair over diff headings, with the comment "The
builtin gitcommit/diff ftplugins don't map [[/]]?"
— and in a log they are
equally inert, since a timestamp begins every line and column one is never a
brace.

Job buffers only; a checks list has no sections.

## Checklist - [x] I have read [CONTRIBUTING.md](https://forge.barrettruth.com/barrettruth/ci.nvim/src/branch/main/CONTRIBUTING.md). - [ ] No AI was used to generate, edit, or review any part of this contribution. ## Problem I claimed fold motions already covered this. They do not — **nothing native selects a fold level**, and a group is a fold just as much as a step is: ``` zj -> 3 ##[group]Runner Image P | 10 ##[group]Operating Syst | 14 ##[group]Runner Image ]z -> 29 Download action reposit | 29 (same) | 29 (same) 3zj -> 14 ##[group]Runner Image | 32 ##[group]Run actions/ch | 58 ##[group]Initializing t ``` `zj` lands on four groups before reaching the second step. `]z` only finds the end of the fold you are already in. A count on `zj` counts folds of *any* level, so `3zj` is wherever three groups happen to fall. `zM` then `j` does walk steps — the answer I gave — but only by collapsing the buffer, which throws away the view you were reading. ## Solution ``` ]] -> 30 ✓ Run actions/che | 130 ✓ Run ./.github/a | 311 ✓ Initialize Code | 1181 ✓ Run make 2]] -> 130 ✓ Run ./.github/a | 1181 ✓ Run make [[ from 1200 -> 1181 jumplist ok, '' -> 1200 ``` Count-aware, and it sets `''` so `<C-o>` brings you back. The level is read from the fold data already computed for `foldexpr` rather than from a search, so it cannot disagree with the folds. `guh.nvim` maps the same pair over diff headings, with the comment *"The builtin gitcommit/diff ftplugins don't map `[[`/`]]`?"* — and in a log they are equally inert, since a timestamp begins every line and column one is never a brace. Job buffers only; a checks list has no sections.
feat: ]] and [[ move by step
All checks were successful
quality / Test (pull_request) Successful in 4s
quality / Format (pull_request) Successful in 9s
quality / Lint (pull_request) Successful in 10s
7c07338583
I argued these were unnecessary because fold motions cover them. They do not.
zj goes to the next fold start and a group is a fold, so from the top of a
job it lands on four groups before reaching the second step; ]z only finds
the end of the fold you are in; a count on zj counts folds of any level, so
3zj is wherever three groups happen to fall. Collapsing with zM does make j
walk steps, but only by throwing away the view you were reading.

Nothing native selects a level, so the level is read from the fold data we
already compute. guh maps these for the same reason, over diff headings, and
notes that the builtin motions are unmapped there — in a log they are inert
too, since a timestamp starts every line and column one is never a brace.
barrettruth deleted branch feat/step-motions 2026-07-28 00:05:47 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
barrettruth/ci.nvim!28
No description provided.