mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(image): check to update on BufWinEnter and attach to buffer changes
This commit is contained in:
parent
59c5545e91
commit
e18e4f6452
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue