Skip to content

Commit

Permalink
refactor(configs): check actual background instead of opt val
Browse files Browse the repository at this point in the history
  • Loading branch information
bekaboo committed Dec 8, 2023
1 parent e68e054 commit 5139874
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -522,13 +522,13 @@ https://github.com/Bekaboo/dropbar.nvim/assets/76579810/e8c1ac26-0321-4762-9975-
---@param menu dropbar_menu_t
col = function(menu)
if menu.prev_menu then
local offset = 0
if
menu.prev_menu.scrollbar and M.opts.menu.scrollbar.background
then
offset = 1
end
return menu.prev_menu._win_configs.width + offset
return menu.prev_menu._win_configs.width
+ (
menu.prev_menu.scrollbar
and menu.prev_menu.scrollbar.background
and 1
or 0
)
end
local mouse = vim.fn.getmousepos()
local bar = utils.bar.get({ win = menu.prev_win })
Expand Down
12 changes: 7 additions & 5 deletions lua/dropbar/configs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,13 @@ M.opts = {
---@param menu dropbar_menu_t
col = function(menu)
if menu.prev_menu then
local offset = 0
if menu.prev_menu.scrollbar and M.opts.menu.scrollbar.background then
offset = 1
end
return menu.prev_menu._win_configs.width + offset
return menu.prev_menu._win_configs.width
+ (
menu.prev_menu.scrollbar
and menu.prev_menu.scrollbar.background
and 1
or 0
)
end
local mouse = vim.fn.getmousepos()
local bar = utils.bar.get({ win = menu.prev_win })
Expand Down

0 comments on commit 5139874

Please sign in to comment.