Skip to content

Commit

Permalink
feat(winbar): width_percent_below is_winbar parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelot committed May 22, 2022
1 parent 3e956c4 commit 164ef83
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lua/heirline/conditions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ function M.buffer_matches(patterns)
return false
end

function M.width_percent_below(n, thresh)
local winwidth = vim.api.nvim_win_get_width(0)
function M.width_percent_below(n, thresh, is_winbar)
local winwidth
if vim.o.laststatus == 3 and not is_winbar then
winwidth = vim.o.columns
else
winwidth = vim.api.nvim_win_get_width(0)
end

return n / winwidth <= thresh
end

Expand Down

0 comments on commit 164ef83

Please sign in to comment.