mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
fix(image): handle inline images at the same TS node, but that changed url. See #1203
This commit is contained in:
parent
74ce61b727
commit
86e3ddf2e4
1 changed files with 5 additions and 1 deletions
|
@ -234,7 +234,11 @@ function M.inline(buf)
|
|||
return function()
|
||||
local found = {} ---@type table<string, boolean>
|
||||
for _, i in ipairs(M.find(buf)) do
|
||||
local img = imgs[i.id]
|
||||
local img = imgs[i.id] ---@type snacks.image.Placement?
|
||||
if img and img.img.src ~= i.src then
|
||||
img:close()
|
||||
img = nil
|
||||
end
|
||||
|
||||
if not img then
|
||||
img = Snacks.image.placement.new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue