Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lua/inline-diff/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ function M._adjust_scroll(bufnr, ns)
if m[4].virt_lines and m[4].virt_lines_above then
local count = #m[4].virt_lines
if view.topfill ~= count then
vim.fn.win_execute(winid, "lua vim.fn.winrestview({topfill=" .. count .. "})")
vim.api.nvim_win_call(winid, function()
vim.fn.winrestview({ topfill = count })
end)
end
break
end
Expand Down Expand Up @@ -173,7 +175,9 @@ function M._adjust_scroll(bufnr, ns)
local space = win_height - last_line_row - last_line_height
local needed = count - space
if needed > 0 then
vim.fn.win_execute(winid, "normal! " .. needed .. "\5") -- N<C-e>
vim.api.nvim_win_call(winid, function()
vim.cmd.normal(needed .. "\5") -- N<C-e>
end)
end
end
end
Expand Down