Skip to content

Commit 2156bc0

Browse files
authored
fix: symlink file icons rendered when renderer.icons.show.file = false, 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
1 parent 82ab19e commit 2156bc0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lua/nvim-tree/renderer/builder.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ function Builder:build_symlink(node)
189189
symlink_formatted = string.format("%s%s%s", symlink_formatted, arrow, link_to)
190190
end
191191

192-
return { str = icon, hl = { "NvimTreeSymlinkIcon" } }, { str = symlink_formatted, hl = { "NvimTreeSymlink" } }
192+
if self.opts.renderer.icons.show.file then
193+
return { str = icon, hl = { "NvimTreeSymlinkIcon" } }, { str = symlink_formatted, hl = { "NvimTreeSymlink" } }
194+
else
195+
return { str = "", hl = {} }, { str = symlink_formatted, hl = { "NvimTreeSymlink" } }
196+
end
193197
end
194198

195199
---@private

lua/nvim-tree/renderer/components/icons.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ end
1616
---@return string icon
1717
---@return string? name
1818
local function get_folder_icon_default(node, has_children)
19-
local is_symlink = node.links_to ~= nil
19+
local is_symlink = node.link_to ~= nil
2020
local n
2121
if is_symlink and node.open then
2222
n = M.config.glyphs.folder.symlink_open

0 commit comments

Comments
 (0)