-
Notifications
You must be signed in to change notification settings - Fork 61
feature: show language name above code blocks without icons #376
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
Comments
Icons are retrieved from the icon provider, in your case nvim-web-devicons. If one isn't defined for the language then we have no icon to show. |
I don't care about icons, would disable them if I could. But problem is no language name is shown. |
… name ## Details Request: #376 Adds configuration option `code.language_icon` which works with the existing `code.language_name` option. This option is enabled by default so the behavior is identical to what it was before. This changes the behavior if an icon is not available for a particular language. Rather than adding an empty border (old behavior) we now add a line with just the language name. Since the icon provider previously gave us the highlight to use and it could be missing, we now need a fallback. This is set by the new `code.highlight_fallback` option which by default links to the `Normal` highlight group. To make this work is mostly minor implementation details. Continue processing the language even if the icon returned from the provider is missing. After creating the virtual text line check if it's empty before adding it, this would happen if `language_name = false` and there is no icon available. Other minor differences in behavior, but these only impact users who do NOT have the language details concealed, likely by NOT enabling `nvim-treesitter` highlights + these options: - `position = 'left'`: the language name is added after the icon, rather than being skipped by default, to avoid adding the name users will now have to set `language_name = false`, which will add only the icon - `position = 'left'` + `language_padding > 0`: the padding is now added, previously we would skip adding the padding
Added the ability to disable icons here: 8ee2701 Use this configuration: require('render-markdown').setup({
code = { language_icon = false },
}) The behavior in general is a little different, so now if an icon isn't available we'll still show the language. |
great stuff, cheers! |
Neovim version (nvim -v)
0.10.2
Neovim distribution
n/a
Operating system
linux
Terminal emulator / GUI
guake
Describe the bug
the language name is not visible on top of markdown code blocks, for some languages,
like: 'racket', 'as3', or 'custom'. Its not fixed even if I set
code = { enabled = false }
in the config.atleasttest.md
Expected behavior
even if language is a rare or custom name, it should show the name.
Healthcheck output
Plugin configuration
Plugin error log
Confirmations
Additional information
No response
The text was updated successfully, but these errors were encountered: