fix(image): check to update on BufWinEnter and attach to buffer changes

This commit is contained in:
Folke Lemaitre 2025-10-28 22:00:53 +01:00
parent 59c5545e91
commit e18e4f6452
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -16,7 +16,7 @@ function M.new(buf)
self:update()
end, { ms = 100 })
vim.api.nvim_create_autocmd({ "BufWritePost", "WinScrolled" }, {
vim.api.nvim_create_autocmd({ "BufWritePost", "WinScrolled", "BufWinEnter" }, {
group = group,
buffer = buf,
callback = vim.schedule_wrap(update),
@ -30,6 +30,9 @@ function M.new(buf)
end
end,
})
vim.api.nvim_buf_attach(buf, false, {
on_lines = update,
})
vim.schedule(update)
return self
end