From c3f83d78a0f3805a3e9a990ed96af5a29fd0fd6b Mon Sep 17 00:00:00 2001 From: Mike Wyatt Date: Tue, 3 Sep 2024 01:36:09 -0300 Subject: [PATCH] controversial fix --- lua/nvim-drawer/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/nvim-drawer/init.lua b/lua/nvim-drawer/init.lua index 5b9a7e2..4b539cb 100644 --- a/lua/nvim-drawer/init.lua +++ b/lua/nvim-drawer/init.lua @@ -199,6 +199,12 @@ function mod.create_drawer(opts) bufnr = instance.state.windows_and_buffers[winid] or -1 end + -- ... or if we do have a window but don't have a buffer, we use the buffer + -- of the window. + if winid ~= -1 and bufnr == -1 then + bufnr = vim.api.nvim_win_get_buf(winid) + end + -- ... and finally if we are trying to make a new window, we just force it -- to -1 so a buffer will be created. if opts.mode == 'new' then