Use blend = 0 option for DevIcon highlight groups
**Is your feature request related to a problem? Please describe.**
Modern terminal emulators support feature for wide grapheme clusters: it means that icons are displayed a bit bigger than regular text characters. The problem is that when using neovim's vim.o.pumblend, the icons become mismatched in size (due to characters beneath). Here is a screenshot:
<img width="1252" height="877" alt="Image" src="https://github.com/user-attachments/assets/127617a6-cd24-4ca1-a820-cd1059df37fa" />
**Describe the solution you'd like**
The fix is very simple - just add { blend = 0 } to `nvim_set_hl` like this
```lua
nvim_set_hl(0, get_highlight_name(icon_data), {
fg = icon_data.color,
ctermfg = tonumber(icon_data.cterm_color),
blend = 0,
})
```
With this small change all icons are beautifully aligned:
<img width="1517" height="902" alt="Image" src="https://github.com/user-attachments/assets/2d0042c8-aa29-4993-afde-2d180ab577ce" />
**Describe alternatives you've considered**
Currently I have this in my nvim config to bypass set_hl
```lua
{
"nvim-tree/nvim-web-devicons",
config = function()
local function opaque_icons()
local devicons = require("nvim-web-devicons")
devicons.setup({})
local icons = devicons.get_icons()
for _, opts in pairs(icons) do
local hl = "DevIcon" .. opts.name
vim.cmd(("highlight %s blend=0"):format(hl))
end
end
vim.schedule(opaque_icons)
vim.api.nvim_create_autocmd("ColorScheme", { callback = vim.schedule_wrap(opaque_icons) })
end,
},
```
2 条评论