If a user adds an image to a markdown document (via the API, not by adding ![](...)), the document integration will cleanup those images when the document changes, or when the users creates a new split window (and possibly on other events as well). The integration doesn't put these images back.
This is one area of code that we found that leads to this problem.
A solution of the top of my head is to have the document integration (and all integrations) keep track of their own list of managed images. I can go ahead and open a PR if that seems like a good solution @3rd
This was brought to my attention in https://github.com/benlubas/molten-nvim/issues/109 by @V3RGANz
If a user adds an image to a markdown document (via the API, not by adding
![](...)
), the document integration will cleanup those images when the document changes, or when the users creates a new split window (and possibly on other events as well). The integration doesn't put these images back.This is one area of code that we found that leads to this problem.
https://github.com/3rd/image.nvim/blob/master/lua/image/utils/document.lua#L46-L73
Specifically this part, which assumes that all images attached to the window/buffer belong to the image.nvim document integration.
https://github.com/3rd/image.nvim/blob/master/lua/image/utils/document.lua#L46-L49
A solution of the top of my head is to have the document integration (and all integrations) keep track of their own list of managed images. I can go ahead and open a PR if that seems like a good solution @3rd