chore/remove globals (#1279)

* remove renderer globals: nvim_tree_add_trailing nvim_tree_highlight_opened_files nvim_tree_root_folder_modifier nvim_tree_special_files

* remove renderer globals: nvim_tree_icon_padding

* remove renderer globals: nvim_tree_symlink_arrow

* remove renderer globals: nvim_tree_show_icons, nvim_tree_show_icons

* remove renderer globals: nvim_tree_git_hl

* remove renderer globals: nvim_tree_group_empty

* remove renderer globals: respect_buf_cwd

* remove renderer globals: nvim_tree_create_in_closed_folder

* remove globals: consistency in legacy checks

* remove renderer globals: nvim_tree_special_files

* renderer.icons.symbols -> glyphs
This commit is contained in:
Alexander Courtis
2022-05-28 11:08:40 +10:00
committed by GitHub
parent 6abc87b1d9
commit 3ba383d591
17 changed files with 404 additions and 344 deletions

View File

@@ -4,10 +4,10 @@ function M.get_padding(depth)
return string.rep(" ", depth)
end
local function get_padding_arrows(icon_state)
local function get_padding_arrows()
return function(depth, _, _, node)
if node.nodes then
local icon = icon_state.icons.folder_icons[node.open and "arrow_open" or "arrow_closed"]
local icon = M.config.icons.glyphs.folder[node.open and "arrow_open" or "arrow_closed"]
return string.rep(" ", depth - 2) .. icon .. " "
end
return string.rep(" ", depth)
@@ -33,10 +33,8 @@ local function get_padding_indent_markers(depth, idx, nodes_number, _, markers)
end
function M.reload_padding_function()
local icon_state = require("nvim-tree.renderer.icon-config").get_config()
if icon_state.show_folder_icon and icon_state.show_folder_arrows then
M.get_padding = get_padding_arrows(icon_state)
if M.config.icons.show.folder and M.config.icons.show.folder_arrow then
M.get_padding = get_padding_arrows()
end
if M.config.indent_markers.enable then
@@ -45,9 +43,7 @@ function M.reload_padding_function()
end
function M.setup(opts)
M.config = {
indent_markers = opts.renderer.indent_markers,
}
M.config = opts.renderer
end
return M