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

Treesitter overwrites rnoweb-nvim concealing? #4

Open
life00 opened this issue Mar 8, 2024 · 2 comments
Open

Treesitter overwrites rnoweb-nvim concealing? #4

life00 opened this issue Mar 8, 2024 · 2 comments

Comments

@life00
Copy link

life00 commented Mar 8, 2024

Cool project. I was wondering if its possible to use this plugin in markdown environment for inline $ $ and code blocks $$ $$ of LaTeX. I tried but it doesn't seem to work, even though treesitter correctly renders the LaTeX syntax highlighting.

Also I had issues with using this plugin in LaTeX without additional_vim_regex_highlighting = { "latex"}, or disable = { "latex" },, but in markdown I need treesitter to fully be enabled otherwise the syntax highlighting completely breaks for some reason.

Any suggestions?

@bamonroe
Copy link
Owner

bamonroe commented Mar 9, 2024

Hi, thanks. This plugin is only for rnoweb files, since it's mostly a personal project and that's the file format I use. It would not be difficult to make the plugin you describe for markdown using this plugin as a template if you were up for it.

Both rnoweb files and markdown files have multiple languages in them. These multiple languages need to have a treesitter parser that recognizes the parts of the text that apply to both languages. Then, in a neovim plugin, you need to traverse each language present and independently handle how you want to deal with it. You can look at the lua code to see how I've done it with rnoweb files.

Since this plugin is for rnoweb files, it only handles r and latex code blocks and has no support for markdown (and I have no plans on including it at the moment as I don't use markdown). Always happy to accept working pull requests if you wanted to extend the current code.

Could you give more details about what issues you had with latex only documents as that should be fully supported?

@life00
Copy link
Author

life00 commented Mar 9, 2024

Thanks for quick response. Yeah I understand, I will take a look at the code and in case I will get something working I'll make a PR. Regarding the issue I had with LaTeX documents, I really don't understand how it works in background, but I imagine that treesitter overwrites rnoweb-nvim when additional_vim_regex_highlighting = { "latex" }, or disable = { "latex" }, is not set. I may provide additional logs if necessary, just tell me where. I use lazyvim.

@life00 life00 changed the title Usage in markdown files Treesitter overwrites rnoweb-nvim concealing? Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants