Skip to content
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] Images are placed above virtual text in virt text output after they're imported #117

Closed
benlubas opened this issue Jan 3, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@benlubas
Copy link
Owner

benlubas commented Jan 3, 2024

Description

When importing images (either from a ipynb or from the magma output format) images seem to be placed above the heading virtual text after scrolling past the output. This results in the text showing up at the bottom of the output, and the image also shos up at the bottom b/c images will just always assume they're the last thing on the line, that's an image.nvim bug that I should fix one day, but whatever.

Reproduction Steps

Produce an image output, and save it :MoltenSave. Make sure you're using virtual text outputs.

Deinit, then :MoltenLoad. Image shows up like this:

image

Expected Behavior

It should render like this (and it does until I scroll past it for some reason):

image

I think that molten isn't recognizing the virtual text as rendered or done, and it's getting re-rendered somehow, which places it after the image

@benlubas benlubas added the bug Something isn't working label Jan 3, 2024
@V3RGANz
Copy link
Contributor

V3RGANz commented Jan 3, 2024

I am experiencing this issue without any save/load on my second machine (on my first machine everything work as intended). I evaluate cell and it shows blank lines, image, and text intended to be at the top is actually at the bottom overlapping the image.
It also fixes after I open floating window with :MoltenEnter and close it.

P.S.
When I "fix" appearance with :MoltenEnter and then reevaluate cell couple of times, molten seems to not recognise image as cell output and appends new image without clearing old (pic below). However, I think everything is related to the same bug and might be outside of save/load mechanics.

image image

@benlubas
Copy link
Owner Author

benlubas commented Jan 3, 2024

I did find the problem with way we were loading images that was causing this issue.

I wouldn't be surprised if there are other issues tho.

Image nvim just shipped an update that broke some things as well. I have a fix for both issues that I'm aware of but still on a train I'll keep this issue open and at you when both are merged hopefully later tonight (in 3 ish hours)

@benlubas
Copy link
Owner Author

benlubas commented Jan 3, 2024

I'll mention that the first issue of text overlapping the image is an image.nvim issue. The image doesn't always display over its extmark when there are multiple extmarks that take up space on the same line.

I have tried to fix this issue but it's very weird and always feels like a neovim bug, or my implementation breaks some other part of the image nvim plugin lol.

The issue of images hanging around might be a molten problem tho.

@benlubas
Copy link
Owner Author

benlubas commented Jan 4, 2024

@V3RGANz both image.nvim and this have been merged. You can try with latest version of both and hopefully the problem is fixed. if it's now I can take a look maybe later today or tomorrow.

@benlubas
Copy link
Owner Author

Going to close for now, feel free to re-open or create a new issue if you still encounter this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants