feat(views): add hide_done_categories config option (#153)
Problem: Categories where every task is done still render in the buffer, cluttering the view when entire categories are finished. Solution: Add `view.category.hide_done_categories` (boolean, default false). When enabled, `category_view()` skips categories whose tasks are all done/deleted, returns their IDs as `done_cat_hidden_ids`, and `_on_write` merges those IDs into `hidden_ids` passed to `diff.apply()` so hidden tasks are not mistakenly deleted on `:w`.
This commit is contained in:
parent
4596214c0e
commit
b9b12fd2a5
6 changed files with 123 additions and 4 deletions
|
|
@ -509,6 +509,9 @@ function M._on_write(bufnr)
|
|||
if #stack > UNDO_MAX then
|
||||
table.remove(stack, 1)
|
||||
end
|
||||
for id in pairs(buffer.done_cat_hidden_ids()) do
|
||||
hidden[id] = true
|
||||
end
|
||||
local new_refs = diff.apply(lines, s, hidden)
|
||||
M._recompute_counts()
|
||||
buffer.render(bufnr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue