fix: don't populate git status when git unused (#499)
This commit is contained in:
@@ -28,7 +28,9 @@ function M.init(with_open, with_reload)
|
||||
if not M.Tree.cwd then
|
||||
M.Tree.cwd = luv.cwd()
|
||||
end
|
||||
if config.use_git() then
|
||||
git.git_root(M.Tree.cwd)
|
||||
end
|
||||
populate(M.Tree.entries, M.Tree.cwd)
|
||||
|
||||
local stat = luv.fs_stat(M.Tree.cwd)
|
||||
@@ -130,7 +132,9 @@ function M.unroll_dir(node)
|
||||
if #node.entries > 0 then
|
||||
renderer.draw(M.Tree, true)
|
||||
else
|
||||
if config.use_git() then
|
||||
git.git_root(node.absolute_path)
|
||||
end
|
||||
populate(node.entries, node.link_to or node.absolute_path, node)
|
||||
|
||||
renderer.draw(M.Tree, true)
|
||||
|
||||
@@ -354,7 +354,9 @@ function M.populate(entries, cwd, parent_node)
|
||||
return
|
||||
end
|
||||
|
||||
if config.use_git() then
|
||||
vim.schedule(function() git.update_status(entries, cwd, parent_node) end)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user