Skip to content

Commit b659254

Browse files
committed
feat: show relative path of symlink destination
1 parent 011a781 commit b659254

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/nvim-tree/renderer/builder.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
local utils = require "nvim-tree.utils"
2+
local core = require "nvim-tree.core"
23

34
local git = require "nvim-tree.renderer.components.git"
45
local pad = require "nvim-tree.renderer.components.padding"
@@ -160,7 +161,8 @@ function Builder:_build_symlink(node, padding, git_highlight, git_icons_tbl)
160161
local arrow = icons.i.symlink_arrow
161162
local symlink_formatted = node.name
162163
if self.symlink_destination then
163-
symlink_formatted = symlink_formatted .. arrow .. node.link_to
164+
local link_to = utils.path_relative(node.link_to, core.get_cwd())
165+
symlink_formatted = symlink_formatted .. arrow .. link_to
164166
end
165167

166168
local link_highlight = git_highlight or "NvimTreeSymlink"

0 commit comments

Comments
 (0)