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
feat: allow language icon to be disabled while still showing language 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
0 commit comments