Open jonboh opened 5 months ago
I'll try to test the change with the addition of render_inline_math
inOnCursorMove
with the changes that @benlubas has made to image.nvim
to improved performance and see if that would be sufficient to solve the issue. In that case I'll send a PR.
Prerequisites
Neovim Version
NVIM v0.10.0-dev-00e71d3 Build type: Release LuaJIT 2.1.1693350652
Neorg setup
Actual behavior
When an equation is outside of the displayed lines of the buffer and you run
Neorg render-latex
, the latex-renderer will fail to conceal the equation because the image.rendered_geometry == {}, and so image.rendered_geometry.width will be nil, here's the relevant code.Expected behavior
No error should be thrown. This could be fixed by getting the width of the image in a different way that does not relay on the image being currently rendered. A potential solution would be to not conceal equations when
width==nil
, however in that case theinline_math
call should be added to theOnCursorMove
event. Currently that change has an unacceptable performance hit.Steps to reproduce
Potentially conflicting plugins
No response
Other information
No response
Help
None
Implementation help
In the branch I'm currently using in my fork I've removed this error, here's the fix, but it relays in the user continuously re-rendering the equations to get the concealment. I can confirm, that with that change the error no longer appears.