3rd / image.nvim

🖼️ Bringing images to Neovim.
MIT License
1.03k stars 42 forks source link

[bug] get images api changed in the namespace commit #111

Closed benlubas closed 9 months ago

benlubas commented 9 months ago

This broke rendering images in floating windows. Causes it to get stuck in a render loop, causing flickering.

I don't really see a reason the logic should have to change. I think it was an attempt to simplify the logic, but evidently it also changed the meaning. If the change on meaning was intentional, do you remember why?

I don't have a video rn bc I'm on the train writing this from my phone, I can add one in a few hours.

Problem is at lua/image/init.lua:378

Keeping the line that was there before and adding or (opts and opts.buffer and opts.buffer == current_image.buffer and not opts.window) to the condition fixed the problem for me. And seems to not have broken anything else.

3rd commented 9 months ago

Yeah, it was intentional, the API looked weird as it wouldn't return the images with .get_images({ buffer = x }) if they were attached to a window, but the window was not passed to get_images.

When doing the extmark sync I needed to get all the images attached to a buffer regardless of window.

Changing it now to this: image