Skip to content

Commit

Permalink
fix: symlink file icons rendered when renderer.icons.show.file = fals…
Browse files Browse the repository at this point in the history
…e, folder.symlink* was incorrectly rendered as folder.default|open (#2983)

* fix: folder.symlink* was incorrectly rendered as folder.default|open

* fix: symlink file icons rendered when renderer.icons.show.file = false
  • Loading branch information
alex-courtis authored Nov 3, 2024
1 parent 82ab19e commit 2156bc0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lua/nvim-tree/renderer/builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ function Builder:build_symlink(node)
symlink_formatted = string.format("%s%s%s", symlink_formatted, arrow, link_to)
end

return { str = icon, hl = { "NvimTreeSymlinkIcon" } }, { str = symlink_formatted, hl = { "NvimTreeSymlink" } }
if self.opts.renderer.icons.show.file then
return { str = icon, hl = { "NvimTreeSymlinkIcon" } }, { str = symlink_formatted, hl = { "NvimTreeSymlink" } }
else
return { str = "", hl = {} }, { str = symlink_formatted, hl = { "NvimTreeSymlink" } }
end
end

---@private
Expand Down
2 changes: 1 addition & 1 deletion lua/nvim-tree/renderer/components/icons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ end
---@return string icon
---@return string? name
local function get_folder_icon_default(node, has_children)
local is_symlink = node.links_to ~= nil
local is_symlink = node.link_to ~= nil
local n
if is_symlink and node.open then
n = M.config.glyphs.folder.symlink_open
Expand Down

0 comments on commit 2156bc0

Please sign in to comment.