Skip to content

Commit

Permalink
fix: round scrollbar offset instead of flooring
Browse files Browse the repository at this point in the history
  • Loading branch information
willothy committed Sep 27, 2023
1 parent b4b6b4a commit a8457e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/dropbar/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ function dropbar_menu_t:update_scrollbar()
local thumb_height = math.max(1, math.floor(win_height ^ 2 / buf_height))
local offset = math.min(
win_height - thumb_height,
math.floor(win_height * topline / buf_height)
math.floor((win_height * topline / buf_height) + 0.5)
)

if self.scrollbar and vim.api.nvim_win_is_valid(self.scrollbar.thumb) then
Expand Down

0 comments on commit a8457e3

Please sign in to comment.