Closed
Description
Dear developers, please consider changes to the Builder:_build_symlink function in $HOME/.local/share/nvim/lazy/nvim-tree.lua/lua/nvim-tree/renderer/builder.lua
Otherwise there is no way to change the color of the icon, which can ruin the overall style of the theme.
Original:
function Builder:_build_symlink(node)
local icon = icons.i.symlink
local arrow = icons.i.symlink_arrow
local symlink_formatted = node.name
if self.symlink_destination then
local link_to = utils.path_relative(node.link_to, core.get_cwd())
symlink_formatted = symlink_formatted .. arrow .. link_to
end
local link_highlight = "NvimTreeSymlink"
return { str = icon }, { str = symlink_formatted, hl = link_highlight }
end
Modify:
function Builder:_build_symlink(node)
local icon = icons.i.symlink
local arrow = icons.i.symlink_arrow
local symlink_formatted = node.name
if self.symlink_destination then
local link_to = utils.path_relative(node.link_to, core.get_cwd())
symlink_formatted = symlink_formatted .. arrow .. link_to
end
local link_highlight = "NvimTreeSymlink"
local icon_hl = "NvimTreeSymlinkIcon" <----
return { str = icon, hl = icon_hl }, { str = symlink_formatted, hl = link_highlight } <----
end
Here's the problem: