-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Recent image.nvim changes throw off image positions by one #197
Comments
How is it going with this one? I don't know if this helps but below is a collection of screenshots of Molten ( Cells are displaying objects of class (*): class rows:
def __init__(self, rows):
self.n = rows
def _repr_latex_(self):
rows = ""
for i in range(self.n):
rows += f"r_{i} \\\\ "
return f"$\\begin{{matrix}} {rows} \\end{{matrix}}$" The results seemed to depend on the font size of foot. In the left column foot is left to my defaults and screenshots in the right column are produced by reopening Nvim, increasing the font size and running the cells again. We can see that in the left ones the output can either be completely or partially cut off from the cell output window. On the right in the first two cases outputs are completely missing and in the last three they are visible but too small and in the wrong position. (*) The optional dependency pnglatex can not display this latex. The problem is related to this issue which I have fixed in my fork of the project. As the project is really small and last update is from 7 years ago, I would advocate to absorb it to Molten as then it could be easily fixed for everyone. edit. If there is anyway I could help just point me to right direction :) |
I've had this on my list of things to do for a long time. I agree that asking people to install it is a little crazy when it's not really doing much at all. It's just something that carried over from Magma that I didn't think about until I had less time and motivation to work on this As far as fixing these other image rendering issues, I'm pretty sure that it's mainly an image.nvim and or neovim bug that's holding back this PR. That said, I think that #201 might be of interest to you. I'd rather have the image.nvim bug fixed but it's obvious that that's going to take a bit of time. So if you want to try #201 and it fixes your issues, I might just merge it |
I tested the commit from #201 by rebasing it on top of current main branch. Seems that it fixes the issue for taller images but unfortunately As what comes to larger font sizes, their position is now fixed but again it seems that only taller images work. However it seems that the font size affects how tall images have to be as larger font hides Of course there is unrelated issues with large font sizes as the images are not scaled with the font size and changing the font size while nvim will break the images. |
small images not showing up is actually not surprising to me. image.nvim will never try to display an image at a resolution larger than it's true resolution. So if you have a 24x24 image to show, and your cell size is 25x50, image.nvim probably just fails to show the image b/c it's too small. |
There was a change (that I made too, no one to blame but me :P) in image.nvim a little bit ago that changed the way inline images are rendered in relation to their extmarks, they're now rendered one line below instead of on the same line.
Here's the offending line:
3rd/image.nvim@d24d498#diff-90b9887d8ed1bf7a314a020fe9673aacfe3778eac5198d82eafa29f3b2668dc3R153
We just need to throw a
-1
in molten somewherethis was mentioned in the comments of #88
The text was updated successfully, but these errors were encountered: