fix(priority): support <C-a>/<C-x> in all visual modes

Problem: `<C-a>` and `<C-x>` only worked in normal mode for single-task
priority adjustment. In visual mode (`v`, `V`, `<C-v>`), they fell
through to Vim's native number increment. Only `g<C-a>`/`g<C-x>` were
mapped for visual batch priority.

Solution: add `priority_up` and `priority_down` to the visual actions
table so `<C-a>`/`<C-x>` call the batch function in all visual modes.
Add corresponding `x`-mode `<Plug>` mappings. Document that both
mappings work in normal and visual mode.
This commit is contained in:
Barrett Ruth 2026-03-12 20:35:57 -04:00
parent b2456580b5
commit 34242d3b98
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
3 changed files with 40 additions and 6 deletions

View file

@ -402,6 +402,16 @@ vim.keymap.set('n', '<Plug>(pending-priority-down)', function()
require('pending').decrement_priority()
end)
vim.keymap.set('x', '<Plug>(pending-priority-up)', function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<Esc>', true, false, true), 'nx', false)
require('pending').increment_priority_visual()
end)
vim.keymap.set('x', '<Plug>(pending-priority-down)', function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<Esc>', true, false, true), 'nx', false)
require('pending').decrement_priority_visual()
end)
vim.keymap.set('x', '<Plug>(pending-priority-up-visual)', function()
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<Esc>', true, false, true), 'nx', false)
require('pending').increment_priority_visual()