* Update padding.lua * add folder_arrow_padding * update help docs * refactor: renderer.icons.padding renderer.icons.padding -> renderer.icons.padding.icon renderer.icons.folder_arrow_padding -> renderer.icons.padding.folder_arrow * refactor: renderer.icons.padding --------- Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
parent
582ae48c9e
commit
ea5097a1e2
@ -462,7 +462,10 @@ Following is the default configuration. See |nvim-tree-opts| for details. >lua
|
|||||||
hidden_placement = "after",
|
hidden_placement = "after",
|
||||||
diagnostics_placement = "signcolumn",
|
diagnostics_placement = "signcolumn",
|
||||||
bookmarks_placement = "signcolumn",
|
bookmarks_placement = "signcolumn",
|
||||||
padding = " ",
|
padding = {
|
||||||
|
icon = " ",
|
||||||
|
folder_arrow = " ",
|
||||||
|
},
|
||||||
symlink_arrow = " ➛ ",
|
symlink_arrow = " ➛ ",
|
||||||
show = {
|
show = {
|
||||||
file = true,
|
file = true,
|
||||||
@ -1065,10 +1068,14 @@ Configuration options for icons.
|
|||||||
Bookmark icon placement.
|
Bookmark icon placement.
|
||||||
Type: `string`, Default: `signcolumn`
|
Type: `string`, Default: `signcolumn`
|
||||||
|
|
||||||
*nvim-tree.renderer.icons.padding*
|
*nvim-tree.renderer.icons.padding.icon*
|
||||||
Inserted between icon and filename.
|
Inserted between icon and filename.
|
||||||
Type: `string`, Default: `" "`
|
Type: `string`, Default: `" "`
|
||||||
|
|
||||||
|
*nvim-tree.renderer.icons.padding.folder_arrow*
|
||||||
|
Inserted between folder arrow icon and file/folder icon.
|
||||||
|
Type: `string`, Default: `" "`
|
||||||
|
|
||||||
*nvim-tree.renderer.icons.symlink_arrow*
|
*nvim-tree.renderer.icons.symlink_arrow*
|
||||||
Used as a separator between symlinks' source and target.
|
Used as a separator between symlinks' source and target.
|
||||||
Type: `string`, Default: `" ➛ "`
|
Type: `string`, Default: `" ➛ "`
|
||||||
@ -3027,6 +3034,7 @@ needed.
|
|||||||
`sort_by` |nvim-tree.sort.sorter|
|
`sort_by` |nvim-tree.sort.sorter|
|
||||||
`git.ignore` |nvim-tree.filters.git_ignored|
|
`git.ignore` |nvim-tree.filters.git_ignored|
|
||||||
`renderer.icons.webdev_colors` |nvim-tree.renderer.icons.web_devicons.file.color|
|
`renderer.icons.webdev_colors` |nvim-tree.renderer.icons.web_devicons.file.color|
|
||||||
|
`renderer.icons.padding` |nvim-tree.renderer.icons.padding.icon|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
14.2 LEGACY: HIGHLIGHT *nvim-tree-legacy-highlight*
|
14.2 LEGACY: HIGHLIGHT *nvim-tree-legacy-highlight*
|
||||||
@ -3183,7 +3191,8 @@ highlight group is not, hard linking as follows: >
|
|||||||
|nvim-tree.renderer.icons.glyphs.symlink|
|
|nvim-tree.renderer.icons.glyphs.symlink|
|
||||||
|nvim-tree.renderer.icons.hidden_placement|
|
|nvim-tree.renderer.icons.hidden_placement|
|
||||||
|nvim-tree.renderer.icons.modified_placement|
|
|nvim-tree.renderer.icons.modified_placement|
|
||||||
|nvim-tree.renderer.icons.padding|
|
|nvim-tree.renderer.icons.padding.folder_arrow|
|
||||||
|
|nvim-tree.renderer.icons.padding.icon|
|
||||||
|nvim-tree.renderer.icons.show|
|
|nvim-tree.renderer.icons.show|
|
||||||
|nvim-tree.renderer.icons.show.bookmarks|
|
|nvim-tree.renderer.icons.show.bookmarks|
|
||||||
|nvim-tree.renderer.icons.show.diagnostics|
|
|nvim-tree.renderer.icons.show.diagnostics|
|
||||||
|
|||||||
@ -334,7 +334,10 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
|
|||||||
hidden_placement = "after",
|
hidden_placement = "after",
|
||||||
diagnostics_placement = "signcolumn",
|
diagnostics_placement = "signcolumn",
|
||||||
bookmarks_placement = "signcolumn",
|
bookmarks_placement = "signcolumn",
|
||||||
padding = " ",
|
padding = {
|
||||||
|
icon = " ",
|
||||||
|
folder_arrow = " ",
|
||||||
|
},
|
||||||
symlink_arrow = " ➛ ",
|
symlink_arrow = " ➛ ",
|
||||||
show = {
|
show = {
|
||||||
file = true,
|
file = true,
|
||||||
|
|||||||
@ -60,6 +60,13 @@ local function refactored(opts)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
utils.move_missing_val(opts, "update_focused_file", "ignore_list", opts, "update_focused_file.update_root", "ignore_list", true)
|
utils.move_missing_val(opts, "update_focused_file", "ignore_list", opts, "update_focused_file.update_root", "ignore_list", true)
|
||||||
|
|
||||||
|
-- 2025/04/30
|
||||||
|
if opts.renderer and opts.renderer.icons and type(opts.renderer.icons.padding) == "string" then
|
||||||
|
local icons_padding = opts.renderer.icons.padding
|
||||||
|
opts.renderer.icons.padding = {}
|
||||||
|
opts.renderer.icons.padding.icon = icons_padding
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function deprecated(opts)
|
local function deprecated(opts)
|
||||||
|
|||||||
@ -140,7 +140,7 @@ function Builder:format_line(indent_markers, arrows, icon, name, node)
|
|||||||
end
|
end
|
||||||
for _, v in ipairs(t2) do
|
for _, v in ipairs(t2) do
|
||||||
if added_len > 0 then
|
if added_len > 0 then
|
||||||
table.insert(t1, { str = self.explorer.opts.renderer.icons.padding })
|
table.insert(t1, { str = self.explorer.opts.renderer.icons.padding.icon })
|
||||||
end
|
end
|
||||||
table.insert(t1, v)
|
table.insert(t1, v)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -95,15 +95,15 @@ function M.get_arrows(node)
|
|||||||
local dir = node:as(DirectoryNode)
|
local dir = node:as(DirectoryNode)
|
||||||
if dir then
|
if dir then
|
||||||
if dir.open then
|
if dir.open then
|
||||||
str = M.config.icons.glyphs.folder["arrow_open"] .. " "
|
str = M.config.icons.glyphs.folder["arrow_open"] .. M.config.icons.padding.folder_arrow
|
||||||
hl = "NvimTreeFolderArrowOpen"
|
hl = "NvimTreeFolderArrowOpen"
|
||||||
else
|
else
|
||||||
str = M.config.icons.glyphs.folder["arrow_closed"] .. " "
|
str = M.config.icons.glyphs.folder["arrow_closed"] .. M.config.icons.padding.folder_arrow
|
||||||
end
|
end
|
||||||
elseif M.config.indent_markers.enable then
|
elseif M.config.indent_markers.enable then
|
||||||
str = ""
|
str = ""
|
||||||
else
|
else
|
||||||
str = " "
|
str = " " .. string.rep(" ", #M.config.icons.padding.folder_arrow)
|
||||||
end
|
end
|
||||||
|
|
||||||
return { str = str, hl = { hl } }
|
return { str = str, hl = { hl } }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user