feat: add cancelled task status with configurable state chars (#158)
Problem: the task lifecycle only has `pending`, `wip`, `blocked`, and `done`. There is no way to mark a task as abandoned. Additionally, state characters (`>`, `=`) are hardcoded rather than reading from `config.icons`, so customizing them has no effect on rendering or parsing. Solution: add a `cancelled` status with default state char `c`, `g/` keymap, `PendingCancelled` highlight, filter predicate, and archive support. Unify state chars by making `state_char()`, `parse_buffer()`, and `infer_status()` read from `config.icons`. Change defaults to mnemonic chars: `w` (wip), `b` (blocked), `c` (cancelled).
This commit is contained in:
parent
4a37cb64e4
commit
7c3ba31c43
9 changed files with 109 additions and 45 deletions
|
|
@ -1,6 +1,6 @@
|
|||
local config = require('pending.config')
|
||||
|
||||
---@alias pending.TaskStatus 'pending'|'done'|'deleted'|'wip'|'blocked'
|
||||
---@alias pending.TaskStatus 'pending'|'done'|'deleted'|'wip'|'blocked'|'cancelled'
|
||||
---@alias pending.RecurMode 'scheduled'|'completion'
|
||||
|
||||
---@class pending.TaskExtra
|
||||
|
|
@ -331,7 +331,7 @@ function Store:update(id, fields)
|
|||
end
|
||||
end
|
||||
task.modified = now
|
||||
if fields.status == 'done' or fields.status == 'deleted' then
|
||||
if fields.status == 'done' or fields.status == 'deleted' or fields.status == 'cancelled' then
|
||||
task['end'] = task['end'] or now
|
||||
end
|
||||
return task
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue