refacto: simplify interface of reload and explore

also make common group empty check in explorer utils
This commit is contained in:
kiyan
2022-02-20 15:08:36 +01:00
parent 41f51508e3
commit 527d88d54e
6 changed files with 32 additions and 25 deletions

View File

@@ -1,3 +1,5 @@
local uv = vim.loop
local utils = require'nvim-tree.utils'
local M = {
@@ -60,6 +62,12 @@ function M.should_ignore_git(path, status)
and (M.config.filter_git_ignored and status and status[path] == '!!')
end
function M.has_one_child_folder(node)
return #node.nodes == 1
and node.nodes[1].nodes
and uv.fs_access(node.nodes[1].absolute_path, 'R')
end
function M.setup(opts)
M.config = {
filter_ignored = true,