Skip to content

feat(#3113): add renderer.icons.folder_arrow_padding #3114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/nvim-tree-lua.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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: `" ➛ "`
Expand Down Expand Up @@ -3173,6 +3178,7 @@ highlight group is not, hard linking as follows: >
|nvim-tree.renderer.icons|
|nvim-tree.renderer.icons.bookmarks_placement|
|nvim-tree.renderer.icons.diagnostics_placement|
|nvim-tree.renderer.icons.folder_arrow_padding|
|nvim-tree.renderer.icons.git_placement|
|nvim-tree.renderer.icons.glyphs|
|nvim-tree.renderer.icons.glyphs.default|
Expand Down
1 change: 1 addition & 0 deletions lua/nvim-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions lua/nvim-tree/renderer/components/padding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"] .. " "
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"] .. " "
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 } }
Expand Down
Loading