famiu
### ๐ค Which branch are you using? - [ ] dev - [x] main ### ๐ Issue description: In a markdown file containing LaTeX, when a LaTeX symbol is followed by an empty group, treesitter captures it as `@latex.command` instead of `@latex.symbol`. The command renderer then finds no matching config and renders nothing. I would've made a PR to fix this directly but I want to confirm if this actually is an issue. IMO it is, since `\leq{}` is valid LaTeX syntax. Additionally, some renderers actually erase empty space after LaTeX symbols unless an empty group is used, so people might defensively add empty groups after symbols in their LaTeX to prevent that. Also, I'm wondering how to fix this as well. I see two possible ways, one is to just add the logic in the `latex.command` function and check if it's a symbol there. It's a short fix but is inelegant design-wise. The other possible fix is to fix it directly at the treesitter capture level, which is a better design choice but might be a bit more complex. ### ๐ Reproduction steps: 1. Open Neovim 2. Go to markdown file with LaTeX symbol followed by empty group 3. Markdown doesn't render correctly ### ๐ป Minimal init: ```lua vim.env.LAZY_STDPATH = ".repro" load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))() require("lazy.minit").repro({ spec = { { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", ensure_installed = { "html", "latex", "markdown", "markdown_inline", "typst", "yaml" } }, { "OXY2DEV/markview.nvim", lazy = false, opts = {} } }, }); ``` ### ๐ Logs: LOG | markview/autocmds.lua => lazy_loaded() | Lazy load hook fired. LOG | fn() | Registered integration: blink.cmp LOG | markview/actions.lua => autocmd() -> on_attach | Fired on_attach & MarkviewAttach. LOG | markview/actions.lua => autocmd() -> on_enable | Fired on_enable & MarkviewEnable. LOG | renderer.lua => clear() | Clearing: 6 LOG | renderer.lua => clear() | Clearing total(6): 0ms LOG | renderer.lua => clear() | Clearing: 6 LOG | renderer.lua => clear() | Clearing total(6): 0ms LOG | markview/actions.lua => render() | Rendering preview. LOG | parsers.lua => init() | Parsing(start): 6 LOG | fn() | Parsing total(6): 14ms LOG | renderer.lua => render() | Rendering: 6 LOG | renderer.lua => render() | Render(main): 167ms LOG | renderer.lua => render() | Render(post): 0ms LOG | renderer.lua => render() | Rendering total(6): 168ms LOG | markview/autocmds.lua => bufHandle() -> /home/famiu/Dev/competitive-programming/problems/spoj/etf/problem.md | Buffer state changed. LOG | markview/actions.lua => attach() | Attached to 7. LOG | markview/actions.lua => autocmd() -> on_attach | Fired on_attach & MarkviewAttach. LOG | markview/actions.lua => set_query() | Set tree-sitter queries for 7. LOG | markview/actions.lua => autocmd() -> on_enable | Fired on_enable & MarkviewEnable. LOG | renderer.lua => clear() | Clearing: 7 LOG | renderer.lua => clear() | Clearing total(7): 0ms LOG | markview/actions.lua => render() | Rendering preview. LOG | parsers.lua => init() | Parsing(start): 7 LOG | fn() | Parsing total(7): 3ms LOG | renderer.lua => render() | Rendering: 7 LOG | renderer.lua => render() | Render(main): 2ms LOG | renderer.lua => render() | Render(post): 0ms LOG | renderer.lua => render() | Rendering total(7): 2ms LOG | markview/actions.lua => autocmd() -> on_hybrid_enable | Fired on_hybrid_enable & MarkviewHybridEnable. LOG | markview/actions.lua => set_query() | Set tree-sitter queries for 7. LOG | markview/autocmds.lua => optionSet() -> filetype | Option changed. LOG | markview/autocmds.lua => optionSet() -> wrap | Option changed. LOG | markview/autocmds.lua => optionSet() -> wrap | Option changed. LOG | markview/autocmds.lua => optionSet() -> linebreak | Option changed. LOG | markview/autocmds.lua => optionSet() -> filetype | Option changed. LOG | markview/autocmds.lua => optionSet() -> wrap | Option changed. LOG | markview/autocmds.lua => optionSet() -> linebreak | Option changed. ### Neovim version: NVIM v0.13.0-dev+868-aa3823cca3 ### โ Expected behavior: Markview should render the LaTeX symbols correctly