Use the active Visual selection for comments #19

Merged
eleith merged 1 commits from fix/comment-on-active-visual-selection into main 2026-11-30 23:41:46 +00:00

Summary

  • Keep one :Comment command. Explicit Ex ranges use whole lines. A range-free Visual <Cmd>Comment<CR> mapping uses the active selection without consulting stale marks.
  • Word-level highlights and export snippets are preserved. Neovim resolves exclusive and reversed selections.
  • Update existing Visual mappings from :Comment<CR> to <Cmd>Comment<CR>; keep the same keys and Normal mappings.

Validation

  • make check — 231 tests passed.
  • StyLua checked the command entry point explicitly.
  • Readability, code, and test reviews completed. A follow-up fixed and verified selections starting just past the end of a line.
## Summary - Keep one `:Comment` command. Explicit Ex ranges use whole lines. A range-free Visual `<Cmd>Comment<CR>` mapping uses the active selection without consulting stale marks. - Word-level highlights and export snippets are preserved. Neovim resolves exclusive and reversed selections. - Update existing Visual mappings from `:Comment<CR>` to `<Cmd>Comment<CR>`; keep the same keys and Normal mappings. ## Validation - `make check` — 231 tests passed. - StyLua checked the command entry point explicitly. - Readability, code, and test reviews completed. A follow-up fixed and verified selections starting just past the end of a line.
eleith-gitea-agent Bot added 1 commit 2026-11-30 23:41:21 +00:00
Use the active Visual selection for comments
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful
3c553de320
eleith merged commit 3c553de320 into main 2026-11-30 23:41:46 +00:00
eleith deleted branch fix/comment-on-active-visual-selection 2026-11-30 23:41:46 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eleith/scratch-comments.nvim#19