Skip to content

Commit d87671c

Browse files
committed
add folder_arrow_padding
1 parent 6ade233 commit d87671c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

doc/nvim-tree-lua.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ Following is the default configuration. See |nvim-tree-opts| for details. >lua
463463
diagnostics_placement = "signcolumn",
464464
bookmarks_placement = "signcolumn",
465465
padding = " ",
466+
folder_arrow_padding = " ",
466467
symlink_arrow = " ➛ ",
467468
show = {
468469
file = true,
@@ -1069,6 +1070,10 @@ Configuration options for icons.
10691070
Inserted between icon and filename.
10701071
Type: `string`, Default: `" "`
10711072

1073+
*nvim-tree.renderer.icons.folder_arrow_padding*
1074+
Inserted between folder arrow icon and file/folder icon.
1075+
Type: `string`, Default: `" "`
1076+
10721077
*nvim-tree.renderer.icons.symlink_arrow*
10731078
Used as a separator between symlinks' source and target.
10741079
Type: `string`, Default: `" ➛ "`

lua/nvim-tree.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
335335
diagnostics_placement = "signcolumn",
336336
bookmarks_placement = "signcolumn",
337337
padding = " ",
338+
folder_arrow_padding = " ",
338339
symlink_arrow = "",
339340
show = {
340341
file = true,

lua/nvim-tree/renderer/components/padding.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ function M.get_arrows(node)
9595
local dir = node:as(DirectoryNode)
9696
if dir then
9797
if dir.open then
98-
str = M.config.icons.glyphs.folder["arrow_open"] .. M.config.icons.padding
98+
str = M.config.icons.glyphs.folder["arrow_open"] .. M.config.icons.folder_arrow_padding
9999
hl = "NvimTreeFolderArrowOpen"
100100
else
101-
str = M.config.icons.glyphs.folder["arrow_closed"] .. M.config.icons.padding
101+
str = M.config.icons.glyphs.folder["arrow_closed"] .. M.config.icons.folder_arrow_padding
102102
end
103103
elseif M.config.indent_markers.enable then
104104
str = ""
105105
else
106-
str = " "
106+
str = " " .. string.rep(" ", #M.config.icons.folder_arrow_padding)
107107
end
108108

109109
return { str = str, hl = { hl } }

0 commit comments

Comments
 (0)