mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(image): detach image when reloading image file. Closes #2343
This commit is contained in:
parent
c9528341a6
commit
7bf4175588
1 changed files with 1 additions and 4 deletions
|
|
@ -4,10 +4,7 @@ local M = {}
|
|||
---@param buf number
|
||||
---@param opts? snacks.image.Opts|{src?: string}
|
||||
function M._attach(buf, opts)
|
||||
if vim.b[buf].snacks_image_buf_attached then
|
||||
return
|
||||
end
|
||||
vim.b[buf].snacks_image_buf_attached = true
|
||||
Snacks.image.placement.clean(buf)
|
||||
opts = opts or {}
|
||||
local file = opts.src or vim.api.nvim_buf_get_name(buf)
|
||||
if not Snacks.image.supports(file) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue