From e895cf306988168ce14c6185a0fb6c6b1afb43b8 Mon Sep 17 00:00:00 2001 From: pynappo Date: Sun, 16 Mar 2025 03:08:00 -0700 Subject: [PATCH] use readlink over realpath for links --- lua/neo-tree/sources/common/components.lua | 11 +++++------ lua/neo-tree/sources/common/file-items.lua | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lua/neo-tree/sources/common/components.lua b/lua/neo-tree/sources/common/components.lua index 1e69ca4d..812f6f74 100644 --- a/lua/neo-tree/sources/common/components.lua +++ b/lua/neo-tree/sources/common/components.lua @@ -662,14 +662,13 @@ end ---@param config neotree.Component.Common.SymlinkTarget M.symlink_target = function(config, node, _) - if node.is_link then - return { - text = string.format(config.text_format, node.link_to), - highlight = config.highlight or highlights.SYMBOLIC_LINK_TARGET, - } - else + if not node.is_link then return {} end + return { + text = string.format(config.text_format, node.link_to), + highlight = config.highlight or highlights.SYMBOLIC_LINK_TARGET, + } end ---@class (exact) neotree.Component.Common.Type : neotree.Component diff --git a/lua/neo-tree/sources/common/file-items.lua b/lua/neo-tree/sources/common/file-items.lua index 8394c0fc..ec6424fe 100644 --- a/lua/neo-tree/sources/common/file-items.lua +++ b/lua/neo-tree/sources/common/file-items.lua @@ -126,7 +126,7 @@ function create_item(context, path, _type, bufnr) end if item.type == "link" then item.is_link = true - item.link_to = uv.fs_realpath(path) + item.link_to = uv.fs_readlink(path) if item.link_to ~= nil then item.type = uv.fs_stat(item.link_to).type end