diff --git a/lua/lazy/view/init.lua b/lua/lazy/view/init.lua index 26383da..b27a17e 100644 --- a/lua/lazy/view/init.lua +++ b/lua/lazy/view/init.lua @@ -147,13 +147,7 @@ end function M:update() if self.buf and vim.api.nvim_buf_is_valid(self.buf) then - vim.bo[self.buf].modifiable = true - local view = vim.api.nvim_win_call(self.view.win, vim.fn.winsaveview) self.render:update() - vim.api.nvim_win_call(self.view.win, function() - vim.fn.winrestview(view) - end) - vim.bo[self.buf].modifiable = false vim.cmd.redraw() end end diff --git a/lua/lazy/view/render.lua b/lua/lazy/view/render.lua index 640e9b0..b7bd884 100644 --- a/lua/lazy/view/render.lua +++ b/lua/lazy/view/render.lua @@ -74,7 +74,17 @@ function M:update() end self:trim() + + vim.bo[self.view.buf].modifiable = true + local view = vim.api.nvim_win_call(self.view.win, vim.fn.winsaveview) + self:render(self.view.buf) + + vim.api.nvim_win_call(self.view.win, function() + vim.fn.winrestview(view) + end) + vim.bo[self.view.buf].modifiable = false + vim.diagnostic.set( Config.ns, self.view.buf,