feat(views): pass forge ref and cache to line metadata
Problem: `LineMeta` had no forge fields, so `buffer.lua` could not render forge labels or apply forge-specific highlights. Solution: add `forge_ref` and `forge_cache` fields to `LineMeta`, populated from `task._extra` in both `category_view` and `priority_view`.
This commit is contained in:
parent
253ec9664f
commit
7405390fd9
1 changed files with 6 additions and 0 deletions
|
|
@ -12,6 +12,8 @@ local parse = require('pending.parse')
|
|||
---@field show_category? boolean
|
||||
---@field priority? integer
|
||||
---@field recur? string
|
||||
---@field forge_ref? pending.ForgeRef
|
||||
---@field forge_cache? pending.ForgeCache
|
||||
|
||||
---@class pending.views
|
||||
local M = {}
|
||||
|
|
@ -187,6 +189,8 @@ function M.category_view(tasks)
|
|||
priority = task.priority,
|
||||
overdue = task.status ~= 'done' and task.due ~= nil and parse.is_overdue(task.due) or nil,
|
||||
recur = task.recur,
|
||||
forge_ref = task._extra and task._extra._forge_ref or nil,
|
||||
forge_cache = task._extra and task._extra._forge_cache or nil,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
|
@ -239,6 +243,8 @@ function M.priority_view(tasks)
|
|||
overdue = task.status ~= 'done' and task.due ~= nil and parse.is_overdue(task.due) or nil,
|
||||
show_category = true,
|
||||
recur = task.recur,
|
||||
forge_ref = task._extra and task._extra._forge_ref or nil,
|
||||
forge_cache = task._extra and task._extra._forge_cache or nil,
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue