WIP: feat: visual selection annotations #127

Draft
noe.trevino wants to merge 13 commits from feature-108/visual-selection-annotations into nightly
Owner

Umbrella PR for range annotations. Each step lands here as its own stacked PR.

  • store and track ranges; annotate from Visual mode and :'<,'>HauntAnnotate
  • fold the six sign/annotation render sites into one render/clear pair
  • find a range from any line inside it (delete, toggle, edit)
  • draw ranges (rail by default, range.style config)
  • range-aware outputs: quickfix end_lnum, picker labels, sidekick :L45-L48
  • docs

Companion change outside this repo: haunt-cli needs an EndLine field so it stops stripping ranges.

Refs #108

Umbrella PR for range annotations. Each step lands here as its own stacked PR. - [ ] store and track ranges; annotate from Visual mode and `:'<,'>HauntAnnotate` - [ ] fold the six sign/annotation render sites into one render/clear pair - [ ] find a range from any line inside it (delete, toggle, edit) - [ ] draw ranges (rail by default, `range.style` config) - [ ] range-aware outputs: quickfix `end_lnum`, picker labels, sidekick `:L45-L48` - [ ] docs Companion change outside this repo: `haunt-cli` needs an `EndLine` field so it stops stripping ranges. Refs #108
chore: start #108 visual selection annotations
All checks were successful
Auto Assign / assign (pull_request_target) Successful in 1s
CI / config (pull_request) Successful in 4s
CI / stylua (pull_request) Successful in 4s
CI / Check for debug messages (pull_request) Successful in 5s
CI / tests (pull_request) Successful in 15s
CI / docs (pull_request) Has been skipped
CI / release (pull_request) Has been skipped
CI / ci (pull_request) Successful in 0s
b5ed491e59
Refs #108
- add an end_line param to create_bookmark
- add an end_line field to the Bookmark object
- reject an end_line before line in is_valid_bookmark
- only serialize end_line for ranges

Refs #108
- end range extmarks at col 0 of the line after the range
- add get_extmark_range to read the range back
- clamp the end so it never falls before the start

Refs #108
- read each bookmark's range from its extmark on sync
- tests: undoing a whole-range delete brings the range back

Refs #108
- add an optional range param to annotate
- order and clamp the range to the buffer
- pass end_line through to create_bookmark

Refs #108
- take the range from the Visual selection (v, V, CTRL-V)
- leave Visual mode before prompting
- tests: drive Visual mode through a <Plug> mapping

Refs #108
feat(commands): accept a range on :HauntAnnotate
All checks were successful
Auto Assign / assign (pull_request_target) Successful in 1s
CI / config (pull_request) Successful in 4s
CI / stylua (pull_request) Successful in 6s
CI / Check for debug messages (pull_request) Successful in 4s
CI / release (pull_request) Has been skipped
CI / ci (pull_request) Successful in 0s
CI / tests (pull_request) Successful in 14s
CI / docs (pull_request) Has been skipped
4b5ac2a5a1
- add range to the HauntAnnotate command
- pass line1/line2 through to annotate

Refs #108
- return a nil end from get_extmark_range when the end is not past the start
- read get_extmark_line through get_extmark_range
- store the synced end as-is

Refs #108
- add normalize_end_line as the one "is a range" rule
- normalize end_line in create_bookmark and on load
- test end_line ~= nil in set_bookmark_mark and _build_serializable

Refs #108
- add normalize_range to order and clamp a line range in one place
- reject a range whose start is past the last line with an error notify
- return the raw selection ends from take_visual_range

Refs #108
- compute the command text and range once for has_args commands

Refs #108
test: use the shared helpers in the range specs
All checks were successful
CI / Check for debug messages (pull_request) Successful in 4s
CI / stylua (pull_request) Successful in 6s
CI / config (pull_request) Successful in 7s
CI / tests (pull_request) Successful in 18s
CI / docs (pull_request) Has been skipped
CI / release (pull_request) Has been skipped
CI / ci (pull_request) Successful in 0s
79030be3d0
- read the saved file with helpers.read_bookmarks_file in api_spec
- build and clean up the range sync buffer with helpers in store_spec

Refs #108
Merge pull request 'feat: save visual selections as range annotations' (#128) from feature-108/range-persistence into feature-108/visual-selection-annotations
All checks were successful
CI / Check for debug messages (pull_request) Successful in 3s
CI / config (pull_request) Successful in 4s
CI / stylua (pull_request) Successful in 5s
CI / tests (pull_request) Successful in 14s
CI / docs (pull_request) Has been skipped
CI / release (pull_request) Has been skipped
CI / ci (pull_request) Successful in 0s
7b593d08b6
Reviewed-on: #128
All checks were successful
CI / Check for debug messages (pull_request) Successful in 3s
CI / config (pull_request) Successful in 4s
CI / stylua (pull_request) Successful in 5s
CI / tests (pull_request) Successful in 14s
CI / docs (pull_request) Has been skipped
CI / release (pull_request) Has been skipped
CI / ci (pull_request) Successful in 0s
This pull request is marked as a work in progress.
View command line instructions

Checkout

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

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 nightly
git merge --no-ff feature-108/visual-selection-annotations
git switch feature-108/visual-selection-annotations
git rebase nightly
git switch nightly
git merge --ff-only feature-108/visual-selection-annotations
git switch feature-108/visual-selection-annotations
git rebase nightly
git switch nightly
git merge --no-ff feature-108/visual-selection-annotations
git switch nightly
git merge --squash feature-108/visual-selection-annotations
git switch nightly
git merge --ff-only feature-108/visual-selection-annotations
git switch nightly
git merge feature-108/visual-selection-annotations
git push origin nightly
Sign in to join this conversation.
No description provided.