mirror of https://github.com/folke/lazy.nvim.git
feat(ui): keep cursor position when rendering view
This commit is contained in:
parent
249902ab31
commit
591ded8309
|
@ -136,7 +136,7 @@ function Runner:_start()
|
||||||
wait_step = s.step
|
wait_step = s.step
|
||||||
else
|
else
|
||||||
s.task = self:queue(plugin, step)
|
s.task = self:queue(plugin, step)
|
||||||
plugin._.working = not not s.task
|
plugin._.working = true
|
||||||
active = active + 1
|
active = active + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -146,7 +146,11 @@ end
|
||||||
function M:update()
|
function M:update()
|
||||||
if self.buf and vim.api.nvim_buf_is_valid(self.buf) then
|
if self.buf and vim.api.nvim_buf_is_valid(self.buf) then
|
||||||
vim.bo[self.buf].modifiable = true
|
vim.bo[self.buf].modifiable = true
|
||||||
|
local view = vim.api.nvim_win_call(self.view.win, vim.fn.winsaveview)
|
||||||
self.render:update()
|
self.render:update()
|
||||||
|
vim.api.nvim_win_call(self.view.win, function()
|
||||||
|
vim.fn.winrestview(view)
|
||||||
|
end)
|
||||||
vim.bo[self.buf].modifiable = false
|
vim.bo[self.buf].modifiable = false
|
||||||
vim.cmd.redraw()
|
vim.cmd.redraw()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue