You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Details
Request: #233
When rendering an icon for a code block ideally we could handle both
the language name `python` as well as the extension `py`. Currently only
the former works while the latter results in a default icon from the
icon provider if configured.
To handle this resolve the input language to a filetype using
`vim.filetype.match` with a filename. The filename is generated by using
a random name, in this case `a`, and appending the language as the
extension. If the match is nil then assume the input language is the
filetype. For the python example this means:
- python: vim.filetype.match({ filename = 'a.python' }) -> nil or python -> python
- py: vim.filetype.match({ filename = 'a.py' }) -> python or py -> python
This approach is taken from the `nvim-treesitter` directive `set-lang-from-info-string`:
https://github.com/nvim-treesitter/nvim-treesitter/blob/master/lua/nvim-treesitter/query_predicates.lua,
aligning icon resolution with treesitter highlighting should make things
feel consistent. If syntax highlighting works we can probably get an
icon, if there is no syntax highlighting then we probably can't.
Other change, update troubleshooting docs to validate parse tree.
- table support for all conceal levels [3da1bfc](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/3da1bfc4bd3a13fee57551f0b705ebcf2614d7a2)
10
+
- roll own type validation to remove vim.validate [d69a885](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/d69a885e1bf21cb329d2eafe56fd80b6de627216)
0 commit comments