refactor(config): nest view settings under view key

Problem: View-related config fields (`default_view`, `eol_format`,
`category_order`, `folding`) are scattered as top-level siblings
alongside unrelated fields like `data_path` and `date_syntax`.

Solution: Group them under a `view` table with per-view sub-tables:
`view.default`, `view.eol_format`, `view.category.order`,
`view.category.folding`, and `view.queue` (empty, ready for #100).
Update all call sites, tests, and vimdoc.
This commit is contained in:
Barrett Ruth 2026-03-08 19:10:01 -04:00
parent 91cce0a82e
commit 740849588e
5 changed files with 82 additions and 73 deletions

View file

@ -440,7 +440,7 @@ end
local function apply_extmarks(bufnr, line_meta)
local cfg = config.get()
local icons = cfg.icons
local eol_segments = parse_eol_format(cfg.eol_format or '%c %r %d')
local eol_segments = parse_eol_format(cfg.view.eol_format or '%c %r %d')
vim.api.nvim_buf_clear_namespace(bufnr, ns_eol, 0, -1)
vim.api.nvim_buf_clear_namespace(bufnr, ns_inline, 0, -1)
for i, m in ipairs(line_meta) do
@ -578,7 +578,7 @@ function M.render(bufnr)
return
end
current_view = current_view or config.get().default_view
current_view = current_view or config.get().view.default
local view_label = current_view == 'priority' and 'queue' or current_view
vim.api.nvim_buf_set_name(bufnr, 'pending://' .. view_label)
local all_tasks = _store and _store:active_tasks() or {}