3rd / image.nvim

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

Bug: inline images don't account for concealed text or virtual text in the same line #155

Closed benlubas closed 5 months ago

benlubas commented 5 months ago

Examples

unconcealed text: image

concealed text: image

images rendering inline without concealed text: image

benlubas commented 5 months ago

problem

There is no good way to get information about text concealed by TS/syntax. This concealed text causes the desired image position to move, with no way for us to figure that out, we can't display the image in the right spot.

Potential workarounds

There's synconcealed(), but this method returns information about a single character at a time. this just doesn't work for TS concealment I guess.

There's vim.inspect_pos(), but this also returns information about a single character at a time.

We could try to run a TS query for concealed items.. though I don't think TS works like that

screenpos() is also an option it explicitly ignores concealed text