feat(init): multi-level priority with <C-a>/<C-x>

Problem: priority was binary (0 or 1), toggled with !, with no way
to express finer gradations or use Vim's native increment idiom.

Solution: replace toggle_priority with change_priority(delta) which
clamps to floor 0. Display format changes from '! ' to '[N] ' so any
integer level is representable. Parser updated to extract numeric
level from the [N] prefix. Visual g<C-a>/g<C-x> apply the delta to
all tasks in the selection. <Plug>(pending-priority) replaced with
<Plug>(pending-priority-up) and <Plug>(pending-priority-down).
This commit is contained in:
Barrett Ruth 2026-02-24 22:01:21 -05:00 committed by Barrett Ruth
parent aae6989a19
commit fc4a47a1ec
5 changed files with 60 additions and 13 deletions

View file

@ -9,6 +9,7 @@ local config = require('pending.config')
---@field category? string
---@field overdue? boolean
---@field show_category? boolean
---@field priority? integer
---@class pending.views
local M = {}
@ -138,7 +139,7 @@ function M.category_view(tasks)
for _, task in ipairs(all) do
local prefix = '/' .. task.id .. '/'
local indent = ' '
local prio = task.priority == 1 and '! ' or ''
local prio = task.priority > 0 and ('[' .. task.priority .. '] ') or ''
local line = prefix .. indent .. prio .. task.description
table.insert(lines, line)
table.insert(meta, {