From 49c93f08fe5181a732bd63498d5f818deb11e7ce Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 24 Feb 2026 22:25:00 -0500 Subject: [PATCH] ci: format --- lua/pending/buffer.lua | 28 +++++++++++++--------------- spec/parse_spec.lua | 14 ++++++++++---- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/lua/pending/buffer.lua b/lua/pending/buffer.lua index 861aca3..7c730e6 100644 --- a/lua/pending/buffer.lua +++ b/lua/pending/buffer.lua @@ -175,22 +175,20 @@ local function restore_folds(bufnr) end for _, winid in ipairs(vim.fn.win_findbuf(bufnr)) do local state = _fold_state[winid] - if not state or next(state) == nil then - goto continue - end - vim.api.nvim_win_call(winid, function() - vim.cmd('normal! zx') - local saved = vim.api.nvim_win_get_cursor(0) - for lnum, m in ipairs(_meta) do - if m.type == 'header' and m.category and state[m.category] then - vim.api.nvim_win_set_cursor(0, { lnum, 0 }) - vim.cmd('normal! zc') + if state and next(state) ~= nil then + vim.api.nvim_win_call(winid, function() + vim.cmd('normal! zx') + local saved = vim.api.nvim_win_get_cursor(0) + for lnum, m in ipairs(_meta) do + if m.type == 'header' and m.category and state[m.category] then + vim.api.nvim_win_set_cursor(0, { lnum, 0 }) + vim.cmd('normal! zc') + end end - end - vim.api.nvim_win_set_cursor(0, saved) - end) - _fold_state[winid] = nil - ::continue:: + vim.api.nvim_win_set_cursor(0, saved) + end) + _fold_state[winid] = nil + end end end diff --git a/spec/parse_spec.lua b/spec/parse_spec.lua index b4442e9..ca8047c 100644 --- a/spec/parse_spec.lua +++ b/spec/parse_spec.lua @@ -96,7 +96,10 @@ describe('parse', function() it('resolves due:+2d to today plus 2 days', function() local today = os.date('*t') --[[@as osdate]] - local expected = os.date('%Y-%m-%d', os.time({ year = today.year, month = today.month, day = today.day + 2 })) + local expected = os.date( + '%Y-%m-%d', + os.time({ year = today.year, month = today.month, day = today.day + 2 }) + ) local desc, meta = parse.body('Task due:+2d') assert.are.equal('Task', desc) assert.are.equal(expected, meta.due) @@ -123,7 +126,10 @@ describe('parse', function() it("returns today + 3 days for '+3d'", function() local today = os.date('*t') --[[@as osdate]] - local expected = os.date('%Y-%m-%d', os.time({ year = today.year, month = today.month, day = today.day + 3 })) + local expected = os.date( + '%Y-%m-%d', + os.time({ year = today.year, month = today.month, day = today.day + 3 }) + ) local result = parse.resolve_date('+3d') assert.are.equal(expected, result) end) @@ -139,12 +145,12 @@ describe('parse', function() assert.truthy(result:match('^%d%d%d%d%-%d%d%-%d%d$')) end) - it("returns nil for garbage input", function() + it('returns nil for garbage input', function() local result = parse.resolve_date('notadate') assert.is_nil(result) end) - it("returns nil for empty string", function() + it('returns nil for empty string', function() local result = parse.resolve_date('') assert.is_nil(result) end)