From 6156e07759fd8c7cbf764414f583aa7e47470368 Mon Sep 17 00:00:00 2001 From: bekaboo <18127878294@qq.com> Date: Fri, 23 Aug 2024 01:42:40 -0400 Subject: [PATCH] fix(setup): dropbar attaches to wrong window --- lua/dropbar.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/dropbar.lua b/lua/dropbar.lua index d85c1cdd..ff61f8a2 100644 --- a/lua/dropbar.lua +++ b/lua/dropbar.lua @@ -61,7 +61,12 @@ local function setup(opts) vim.api.nvim_create_autocmd(configs.opts.general.attach_events, { group = groupid, callback = function(info) - utils.bar.attach(info.buf, 0, info) + -- Try attaching dropbar to all windows containing the buffer + -- Notice that we cannot simply let `win=0` here since the current + -- buffer isn't necessarily the window containing the buffer + for _, win in ipairs(vim.fn.win_findbuf(info.buf)) do + utils.bar.attach(info.buf, win, info) + end end, desc = 'Attach dropbar', })