diff --git a/lua/pending/buffer.lua b/lua/pending/buffer.lua index 8fdcbe1..827ff82 100644 --- a/lua/pending/buffer.lua +++ b/lua/pending/buffer.lua @@ -303,6 +303,12 @@ function M.render(bufnr) lines, line_meta = views.category_view(tasks) 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 table.insert(lines, 1, 'FILTER: ' .. table.concat(_filter_predicates, ' ')) table.insert(line_meta, 1, { type = 'filter' }) diff --git a/lua/pending/diff.lua b/lua/pending/diff.lua index 5df332f..6b79b8a 100644 --- a/lua/pending/diff.lua +++ b/lua/pending/diff.lua @@ -33,14 +33,14 @@ function M.parse_buffer(lines) for i = start, #lines do local line = lines[i] - local id, body = line:match('^/(%d+)/(- %[.%] .*)$') + local id, body = line:match('^/(%d+)/(- %[.?%] .*)$') if not id then - body = line:match('^(- %[.%] .*)$') + body = line:match('^(- %[.?%] .*)$') end if line == '' then table.insert(result, { type = 'blank', lnum = i }) elseif id or body then - local stripped = body:match('^- %[.%] (.*)$') or body + local stripped = body:match('^- %[.?%] (.*)$') or body local state_char = body:match('^- %[(.-)%]') or ' ' local priority = state_char == '!' and 1 or 0 local status = state_char == 'x' and 'done' or 'pending'