diff --git a/lua/custom/plugins/overseer.lua b/lua/custom/plugins/overseer.lua index 475a6f0..ab94c49 100644 --- a/lua/custom/plugins/overseer.lua +++ b/lua/custom/plugins/overseer.lua @@ -12,10 +12,25 @@ return { }, } + -- Reference: overseer.nvim/lua/overseer/window.lua + local function is_open() + for _, winid in ipairs(vim.api.nvim_tabpage_list_wins(0)) do + local bufnr = vim.api.nvim_win_get_buf(winid) + if vim.bo[bufnr].filetype == 'OverseerList' then + return true + end + end + return false + end + -- Display status info about tasks vim.keymap.set('n', 'ol', function() overseer.toggle { winid = 0 } - vim.cmd.winc '_' + if is_open() then + vim.cmd.winc '_' + else + vim.api.nvim_buf_delete(vim.api.nvim_get_current_buf(), {}) + end end, { desc = '[O]verseer [L]og' }) -- Run task by listing all in floating vim.keymap.set('n', 'or', 'OverseerRun', { desc = '[O]verseer [R]un' })