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:
parent
aae6989a19
commit
fc4a47a1ec
5 changed files with 60 additions and 13 deletions
|
|
@ -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, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue