mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(picker.list): correct offset calculation for large scrolloff. Closes #1208
This commit is contained in:
parent
4589e25758
commit
f4ca368672
1 changed files with 1 additions and 1 deletions
|
@ -226,7 +226,7 @@ function M:close()
|
|||
end
|
||||
|
||||
function M:scrolloff()
|
||||
local scrolloff = math.min(self.state.scrolloff, math.floor(self:height() / 2))
|
||||
local scrolloff = math.min(self.state.scrolloff, math.floor((self:height() - 1) / 2))
|
||||
local offset = math.min(self.cursor, self:count() - self.cursor)
|
||||
return offset > scrolloff and scrolloff or 0
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue