Skip to content

feature(image): option to keep inline images in insert mode #1478

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

Closed
1 task done
paperbenni opened this issue Mar 1, 2025 · 0 comments · May be fixed by #1434
Closed
1 task done

feature(image): option to keep inline images in insert mode #1478

paperbenni opened this issue Mar 1, 2025 · 0 comments · May be fixed by #1434
Labels
enhancement New feature or request

Comments

@paperbenni
Copy link

Did you check the docs?

  • I have read all the snacks.nvim docs

Is your feature request related to a problem? Please describe.

All inline image rendering gets hidden as soon as insert mode is entered, even if it is not on the line which is being edited.
If I am writing a math expression which relates to a different expression, being able to view the other expression in a rendered format while editing the current one is a lot nicer than looking at the latex source.
Hiding all images while in insert mode also causes a lot of visual changes across the entire screen on every mode switch.

Describe the solution you'd like

As far as I can tell, just removing the mode check from this line

6ea4fa7#diff-ae3c0826707693cb017fb36df5071e7d6a138e52ccf71ea859b9aa1a9b8b78b7R40

achieves the desired behavior (at least in insert mode). Introducing an option to disable or customize the mode check would be nice.

The current behavior also differs from most other conceal features, which only get hidden when being edited or selected, so maybe even changing the default would be a good idea.

In visual mode, hiding all images which are part of the selection but keeping others would also be nice, but I am unsure how much more complicated that would be to implement.

Describe alternatives you've considered

Latex concealment which support partial concealment using other plugins like markview is possible, but glitchy in combination with snacks, looks worse and requires parsing the latex twice. That said, I would definitely appreciate concealing greek letters with unicode so the line looks shorter while editing.

I am sorry for how long this issue is, hopefully some of the ideas are helpful :)

Additional context

No response

@paperbenni paperbenni added the enhancement New feature or request label Mar 1, 2025
@folke folke closed this as completed in bc0630e Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant