add folder_arrow_padding

This commit is contained in:
smchunn 2025-04-24 21:27:09 -04:00
parent 6ade23371d
commit d87671cf15
3 changed files with 9 additions and 3 deletions

View File

@ -463,6 +463,7 @@ Following is the default configuration. See |nvim-tree-opts| for details. >lua
diagnostics_placement = "signcolumn",
bookmarks_placement = "signcolumn",
padding = " ",
folder_arrow_padding = " ",
symlink_arrow = " ➛ ",
show = {
file = true,
@ -1069,6 +1070,10 @@ Configuration options for icons.
Inserted between icon and filename.
Type: `string`, Default: `" "`
*nvim-tree.renderer.icons.folder_arrow_padding*
Inserted between folder arrow icon and file/folder icon.
Type: `string`, Default: `" "`
*nvim-tree.renderer.icons.symlink_arrow*
Used as a separator between symlinks' source and target.
Type: `string`, Default: `" ➛ "`

View File

@ -335,6 +335,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
diagnostics_placement = "signcolumn",
bookmarks_placement = "signcolumn",
padding = " ",
folder_arrow_padding = " ",
symlink_arrow = "",
show = {
file = true,

View File

@ -95,15 +95,15 @@ function M.get_arrows(node)
local dir = node:as(DirectoryNode)
if dir then
if dir.open then
str = M.config.icons.glyphs.folder["arrow_open"] .. M.config.icons.padding
str = M.config.icons.glyphs.folder["arrow_open"] .. M.config.icons.folder_arrow_padding
hl = "NvimTreeFolderArrowOpen"
else
str = M.config.icons.glyphs.folder["arrow_closed"] .. M.config.icons.padding
str = M.config.icons.glyphs.folder["arrow_closed"] .. M.config.icons.folder_arrow_padding
end
elseif M.config.indent_markers.enable then
str = ""
else
str = " "
str = " " .. string.rep(" ", #M.config.icons.folder_arrow_padding)
end
return { str = str, hl = { hl } }