fix(scroll): compat with Neovim 0.9.4

This commit is contained in:
Folke Lemaitre 2025-02-24 10:34:25 +01:00
parent 842605f072
commit 4c52b7f25d
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -227,6 +227,9 @@ local function scroll_lines(win, from, to)
if to.topfill > 0 then
offset = offset - to.topfill
end
if not vim.api.nvim_win_text_height then
return end_row - start_row + offset
end
return vim.api.nvim_win_text_height(win, { start_row = start_row, end_row = end_row }).all + offset - 1
end