feat: draw a rail down range annotations #131

Open
noe.trevino wants to merge 7 commits from feature-108/range-display into feature-108/nesting-rules
Owner

Stacked on #130. Retarget to the umbrella (#127) once the ones below merge.

  • │ down the body lines and ╰ on the last, in the sign column
  • head line keeps the bookmark sign
  • rail sits below gitsigns (priority 5), so git status always shows
  • new range config block: style (rail | none), reveal (always | cursor), glyphs, priority
  • new HauntRange highlight, linked to the sign highlight
  • rail redraws from the tracking extmark on on_lines (one redraw per turn, so undo settles first)
  • toggle all hides the rails too

Calls to look at:

  • a range made while annotations are off starts with its rail hidden

  • reveal = "cursor" follows the current window, so splits show the same rail

  • in insert mode the rail redraws each keystroke (cheap, but scales with covered lines)

  • checked in nvim: rail on 5–10, nested single on 7, dd shrinks it, u brings it back

  • tests pass (656)

  • retarget to the umbrella after #128–#130

Refs #108

Stacked on #130. Retarget to the umbrella (#127) once the ones below merge. - `│` down the body lines and `╰` on the last, in the sign column - head line keeps the bookmark sign - rail sits below gitsigns (priority 5), so git status always shows - new `range` config block: `style` (`rail` | `none`), `reveal` (`always` | `cursor`), `glyphs`, `priority` - new `HauntRange` highlight, linked to the sign highlight - rail redraws from the tracking extmark on `on_lines` (one redraw per turn, so undo settles first) - toggle all hides the rails too Calls to look at: - a range made while annotations are off starts with its rail hidden - `reveal = "cursor"` follows the current window, so splits show the same rail - in insert mode the rail redraws each keystroke (cheap, but scales with covered lines) - [x] checked in nvim: rail on 5–10, nested single on 7, `dd` shrinks it, `u` brings it back - [x] tests pass (656) - [ ] retarget to the umbrella after #128–#130 Refs #108
- add range.style, reveal, glyphs, priority
- warn and fall back on a bad range value
- readme: list the range block

Refs #108
- add HauntRange, linked to the sign highlight

Refs #108
- draw │ on body lines and ╰ on the last line
- rail signs sit below gitsigns (range.priority)
- keep the outer rail where a nested range ends
- clear the rail in clear_bookmark
- no rail when style is "none"

Refs #108
- redraw the rail on nvim_buf_attach on_lines
- on_lines over a decoration provider: real sign marks, less code
- one scheduled redraw per turn, so undo settles first
- detach when a buffer has no ranges

Refs #108
- reveal = "cursor" draws only ranges holding the cursor
- CursorMoved reuses cached spans, redraws only on change
- hide on BufLeave, show on BufEnter

Refs #108
- toggle all hides and shows the rails

Refs #108
test(api): check the rail follows a range resize
All checks were successful
Auto Assign / assign (pull_request_target) Successful in 1s
CI / Check for debug messages (pull_request) Successful in 4s
CI / config (pull_request) Successful in 5s
CI / tests (pull_request) Successful in 16s
CI / docs (pull_request) Has been skipped
CI / release (pull_request) Has been skipped
CI / ci (pull_request) Successful in 0s
CI / stylua (pull_request) Successful in 4s
62831c603a
- tests: rail follows a resize and drops on shrink to one line

Refs #108
noe.trevino added this to the Haunt project 2026-10-13 18:01:19 -05:00
All checks were successful
Auto Assign / assign (pull_request_target) Successful in 1s
CI / Check for debug messages (pull_request) Successful in 4s
CI / config (pull_request) Successful in 5s
CI / tests (pull_request) Successful in 16s
CI / docs (pull_request) Has been skipped
CI / release (pull_request) Has been skipped
CI / ci (pull_request) Successful in 0s
CI / stylua (pull_request) Successful in 4s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature-108/range-display:feature-108/range-display
git switch feature-108/range-display

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch feature-108/nesting-rules
git merge --no-ff feature-108/range-display
git switch feature-108/range-display
git rebase feature-108/nesting-rules
git switch feature-108/nesting-rules
git merge --ff-only feature-108/range-display
git switch feature-108/range-display
git rebase feature-108/nesting-rules
git switch feature-108/nesting-rules
git merge --no-ff feature-108/range-display
git switch feature-108/nesting-rules
git merge --squash feature-108/range-display
git switch feature-108/nesting-rules
git merge --ff-only feature-108/range-display
git switch feature-108/nesting-rules
git merge feature-108/range-display
git push origin feature-108/nesting-rules
Sign in to join this conversation.
No description provided.