feat(renderer): add NvimTreeSymlinkFolderName (#2000)
* Added FolderSymlink color that is applied in builder.lua * changed highlight names and links, changed folder build function * remove NvimTreeSymlinkFolderName --------- Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
parent
68f485b454
commit
f3dbddf8b3
@ -1911,6 +1911,7 @@ as per |:highlight|
|
||||
Default linked group follows name.
|
||||
|
||||
NvimTreeSymlink
|
||||
NvimTreeSymlinkFolderName (Directory)
|
||||
NvimTreeFolderName (Directory)
|
||||
NvimTreeRootFolder
|
||||
NvimTreeFolderIcon
|
||||
|
||||
@ -62,6 +62,7 @@ local function get_links()
|
||||
FolderName = "Directory",
|
||||
EmptyFolderName = "Directory",
|
||||
OpenedFolderName = "Directory",
|
||||
SymlinkFolderName = "Directory",
|
||||
OpenedFolderIcon = "NvimTreeFolderIcon",
|
||||
ClosedFolderIcon = "NvimTreeFolderIcon",
|
||||
Normal = "Normal",
|
||||
|
||||
@ -131,13 +131,7 @@ end
|
||||
function Builder:_build_folder(node)
|
||||
local has_children = #node.nodes ~= 0 or node.has_children
|
||||
local icon = icons.get_folder_icon(node.open, node.link_to ~= nil, has_children)
|
||||
|
||||
local foldername = get_folder_name(node) .. self.trailing_slash
|
||||
if node.link_to and self.symlink_destination then
|
||||
local arrow = icons.i.symlink_arrow
|
||||
local link_to = utils.path_relative(node.link_to, core.get_cwd())
|
||||
foldername = foldername .. arrow .. link_to
|
||||
end
|
||||
|
||||
local icon_hl
|
||||
if #icon > 0 then
|
||||
@ -149,7 +143,14 @@ function Builder:_build_folder(node)
|
||||
end
|
||||
|
||||
local foldername_hl = "NvimTreeFolderName"
|
||||
if vim.tbl_contains(self.special_files, node.absolute_path) or vim.tbl_contains(self.special_files, node.name) then
|
||||
if node.link_to and self.symlink_destination then
|
||||
local arrow = icons.i.symlink_arrow
|
||||
local link_to = utils.path_relative(node.link_to, core.get_cwd())
|
||||
foldername = foldername .. arrow .. link_to
|
||||
foldername_hl = "NvimTreeSymlinkFolderName"
|
||||
elseif
|
||||
vim.tbl_contains(self.special_files, node.absolute_path) or vim.tbl_contains(self.special_files, node.name)
|
||||
then
|
||||
foldername_hl = "NvimTreeSpecialFolderName"
|
||||
elseif node.open then
|
||||
foldername_hl = "NvimTreeOpenedFolderName"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user