mirror of
https://github.com/neovim/neovim.git
synced 2026-04-20 06:20:53 +00:00
fix(scrollbind): properly take filler/virtual lines into account
Problem: `'scrollbind'` does not work properly if the window being scrolled automatically contains any filler/virtual lines (except for diff filler lines). This is because when the scrollbind check is done, the logic only considers changes to topline which are represented as line numbers. Solution: Write the logic for determine the scroll amount to take into account filler/virtual lines. Fixes #29751
This commit is contained in:
committed by
Lewis Russell
parent
c9b129a02a
commit
573a71469d
@@ -835,9 +835,18 @@ function M.exec_capture(code)
|
||||
return M.api.nvim_exec2(code, { output = true }).output
|
||||
end
|
||||
|
||||
--- @param code string
|
||||
--- @param code string|function
|
||||
--- @return any
|
||||
function M.exec_lua(code, ...)
|
||||
if type(code) == 'function' then
|
||||
return M.api.nvim_exec_lua(
|
||||
[[
|
||||
local code = ...
|
||||
return loadstring(code)(select(2, ...))
|
||||
]],
|
||||
{ string.dump(code), ... }
|
||||
)
|
||||
end
|
||||
return M.api.nvim_exec_lua(code, { ... })
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user