fix(buffer): use default_category config for empty placeholder
Problem: The empty-buffer fallback hardcoded the category name `TODO`, ignoring the user's `default_category` config value (default: `Todo`). Solution: Read `config.get().default_category` at render time and use that value for both the header line and `LineMeta` category field.
This commit is contained in:
parent
55e83644b3
commit
9ea049b6a0
1 changed files with 6 additions and 0 deletions
|
|
@ -303,6 +303,12 @@ function M.render(bufnr)
|
||||||
lines, line_meta = views.category_view(tasks)
|
lines, line_meta = views.category_view(tasks)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if #lines == 0 and #_filter_predicates == 0 then
|
||||||
|
local default_cat = config.get().default_category
|
||||||
|
lines = { '# ' .. default_cat }
|
||||||
|
line_meta = { { type = 'header', category = default_cat } }
|
||||||
|
end
|
||||||
|
|
||||||
if #_filter_predicates > 0 then
|
if #_filter_predicates > 0 then
|
||||||
table.insert(lines, 1, 'FILTER: ' .. table.concat(_filter_predicates, ' '))
|
table.insert(lines, 1, 'FILTER: ' .. table.concat(_filter_predicates, ' '))
|
||||||
table.insert(line_meta, 1, { type = 'filter' })
|
table.insert(line_meta, 1, { type = 'filter' })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue