From 2fec155b775213466979ccbdf8362024becbc4e2 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 7 Aug 2024 12:21:50 +0200 Subject: [PATCH] bugfix: overseer delete only empty buffer --- lua/custom/plugins/overseer.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/custom/plugins/overseer.lua b/lua/custom/plugins/overseer.lua index 380929a..3c39ef4 100644 --- a/lua/custom/plugins/overseer.lua +++ b/lua/custom/plugins/overseer.lua @@ -36,10 +36,11 @@ return { -- Display status info about tasks vim.keymap.set('n', 'ol', function() overseer.toggle { winid = 0 } + local bufnr = vim.api.nvim_get_current_buf() if is_open() then vim.cmd.winc '_' - else - vim.api.nvim_buf_delete(vim.api.nvim_get_current_buf(), {}) + elseif vim.bo[bufnr].filetype == '' and vim.bo.buftype ~= 'terminal' then + vim.api.nvim_buf_delete(bufnr, {}) end end, { desc = '[O]verseer [L]og' }) -- Run task by listing all in floating