Skip to content

feat: agenda visual bulk actions#1116

Open
celsobenedetti wants to merge 4 commits intonvim-orgmode:masterfrom
celsobenedetti:feat/agenda_bulk_archive
Open

feat: agenda visual bulk actions#1116
celsobenedetti wants to merge 4 commits intonvim-orgmode:masterfrom
celsobenedetti:feat/agenda_bulk_archive

Conversation

@celsobenedetti
Copy link
Copy Markdown
Contributor

Summary

This PR introduces support for visual mode bulk actions in Agenda view.
Here I'm adding only these two functionalities:

  • Agenda:archive_visual()
  • Agenda:toggle_archive_tag_visual()

If the approach here is endorsed, I hope to create a PR for "add tags" feature as well.

Related Issues

Related #1003

Changes

  • Added two new visual mappings for agenda:
    • <prefix>$ -> Agenda:archive_visual
    • <prefix>A -> Agenda:toggle_archive_tag_visual
  • Introduced 2 internal Agenda methods:
    • Agenda:_get_visual_selection_lines
    • Agenda:_bulk_action

Checklist

I confirm that I have:

  • Followed the
    Conventional Commits
    specification
    (e.g., feat: add new feature, fix: correct bug,
    docs: update documentation).
  • My PR title also follows the conventional commits specification.
  • Updated relevant documentation, if necessary.
  • Thoroughly tested my changes.
  • Added tests (if applicable) and verified existing tests pass with
    make test.
  • Checked for breaking changes and documented them, if any.

@celsobenedetti celsobenedetti marked this pull request as draft April 1, 2026 19:45
  this is done since actions may modify the file, and the precomputed `start_line` may be invalidated.
@celsobenedetti celsobenedetti marked this pull request as ready for review April 2, 2026 13:09
Comment on lines +503 to +505
for i = #lines, 1, -1 do
local line = lines[i]
local headline = line.headline
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added this mechanism to iterate over the agenda items from bottom to top.
This is done mostly because actions such as archive will modify the file, so the intention of iterating bottom to top is to preserve the original get_range().start_line for each heading.

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.

1 participant