From 08f5acc7edf9c03243f74ea6e9d8d1d6241a7535 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Wed, 7 Aug 2024 12:22:43 +0200 Subject: [PATCH] toggle additional overseer splits if window already split --- lua/custom/plugins/overseer.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/custom/plugins/overseer.lua b/lua/custom/plugins/overseer.lua index 3c39ef4..242d0be 100644 --- a/lua/custom/plugins/overseer.lua +++ b/lua/custom/plugins/overseer.lua @@ -35,6 +35,12 @@ return { -- Display status info about tasks vim.keymap.set('n', 'ol', function() + local curWindows = #vim.api.nvim_tabpage_list_wins(0) + if curWindows ~= (is_open() and 2 or 1) then + vim.cmd 'OverseerToggle' + return + end + overseer.toggle { winid = 0 } local bufnr = vim.api.nvim_get_current_buf() if is_open() then