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

feature(image): add condition to judge if a formula should be concealed or rendered. #1500

Open
1 task done
dirichy opened this issue Mar 4, 2025 · 0 comments
Open
1 task done
Labels
enhancement New feature or request

Comments

@dirichy
Copy link

dirichy commented Mar 4, 2025

Did you check the docs?

  • I have read all the snacks.nvim docs

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

The problem is that, firstly, for some very short or easy formula, I don't need them to be rendered. So I want to have a function to judge this, may be some option like

should_be_randered=function(treesitter_node,buffer)

Since I think the treesitter_node and buffer number carrys all information to judge if a formula should be rendered.

The second problem is that since sometimes there will be multiple formula in a line, I don't want to conceal them all or not conceal them all. Instead, I want to conceal those I am not editing and remain the one I am editing. Or some times, when the inline option is on, some formula is too big to be inline, so it will just show a placeholder and show image at next line. I want formulas not inline to be not concealed. So I think we should add more parameter in conceal condition, like treesitter_node, buffer, and whether it will be really inline as parameter of the condition function.

Describe the solution you'd like

Add a option to accept a function to judge if a node should be rendered.
Add more parameter to the function to judge if a node should be concealed.

Describe alternatives you've considered

For conceal may be I can manage them by my self. but for render I have no idea to do that.

Additional context

No response

@dirichy dirichy added the enhancement New feature or request label Mar 4, 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

No branches or pull requests

1 participant