feat: complete task editing coverage
Problem: the task editing surface had gaps — category and recurrence had no keymaps, `:Pending edit` required knowing the task ID, tasks couldn't be reordered with a keymap, priority was binary (0/1), and `wip`/`blocked` states were documented but unimplemented. Solution: fill every cell so every property is editable in every way. - `gc`/`gr` keymaps for category select and recurrence prompt - cursor-aware `:Pending edit` (omit ID to use task under cursor) - `J`/`K` keymaps to reorder tasks within a category - multi-level priorities (`max_priority` config, `g!` cycles 0→1→2→3→0) - `+!!`/`+!!!` tokens in `:Pending edit`, `:Pending add`, `parse.body()` - `PendingPriority2`/`PendingPriority3` highlight groups - `gw`/`gb` keymaps toggle `wip`/`blocked` status - `>`/`=` state chars in buffer rendering and diff parsing - `PendingWip`/`PendingBlocked` highlight groups - sort order: wip → pending → blocked → done - `wip`/`blocked` filter predicates and icons
This commit is contained in:
parent
073541424e
commit
6c3869b3c4
9 changed files with 498 additions and 101 deletions
|
|
@ -43,7 +43,16 @@ function M.parse_buffer(lines)
|
|||
local stripped = body:match('^- %[.?%] (.*)$') or body
|
||||
local state_char = body:match('^- %[(.-)%]') or ' '
|
||||
local priority = state_char == '!' and 1 or 0
|
||||
local status = state_char == 'x' and 'done' or 'pending'
|
||||
local status
|
||||
if state_char == 'x' then
|
||||
status = 'done'
|
||||
elseif state_char == '>' then
|
||||
status = 'wip'
|
||||
elseif state_char == '=' then
|
||||
status = 'blocked'
|
||||
else
|
||||
status = 'pending'
|
||||
end
|
||||
local description, metadata = parse.body(stripped)
|
||||
if description and description ~= '' then
|
||||
table.insert(result, {
|
||||
|
|
@ -117,7 +126,10 @@ function M.apply(lines, s, hidden_ids)
|
|||
task.category = entry.category
|
||||
changed = true
|
||||
end
|
||||
if task.priority ~= entry.priority then
|
||||
if entry.priority == 0 and task.priority > 0 then
|
||||
task.priority = 0
|
||||
changed = true
|
||||
elseif entry.priority > 0 and task.priority == 0 then
|
||||
task.priority = entry.priority
|
||||
changed = true
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue