diff --git a/lua/edgy/edgebar.lua b/lua/edgy/edgebar.lua index 910080d..d50b98b 100644 --- a/lua/edgy/edgebar.lua +++ b/lua/edgy/edgebar.lua @@ -251,8 +251,17 @@ function M:resize() elseif win.visible then auto[#auto + 1] = win -- hidden windows + elseif self.vertical then + win[long] = 1 else - win[long] = self.vertical and 1 or (vim.fn.strdisplaywidth(win.view.title) + 3) + local title_width = vim.fn.strdisplaywidth(win.view.title) + if vim.api.nvim_eval_statusline then + title_width = vim.api.nvim_eval_statusline(win.view.title, { + use_winbar = true, + winid = win.win, + }).width + end + win[long] = title_width + 3 end free = free - win[long] end