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
This commit is contained in:
Alexander Courtis 2024-11-03 12:10:00 +11:00 committed by GitHub
parent 82ab19ebf7
commit 2156bc08c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -189,7 +189,11 @@ function Builder:build_symlink(node)
symlink_formatted = string.format("%s%s%s", symlink_formatted, arrow, link_to) symlink_formatted = string.format("%s%s%s", symlink_formatted, arrow, link_to)
end 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 end
---@private ---@private

View File

@ -16,7 +16,7 @@ end
---@return string icon ---@return string icon
---@return string? name ---@return string? name
local function get_folder_icon_default(node, has_children) 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 local n
if is_symlink and node.open then if is_symlink and node.open then
n = M.config.glyphs.folder.symlink_open n = M.config.glyphs.folder.symlink_open