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
|
if not M.Tree.cwd then
|
||||||
M.Tree.cwd = luv.cwd()
|
M.Tree.cwd = luv.cwd()
|
||||||
end
|
end
|
||||||
git.git_root(M.Tree.cwd)
|
if config.use_git() then
|
||||||
|
git.git_root(M.Tree.cwd)
|
||||||
|
end
|
||||||
populate(M.Tree.entries, M.Tree.cwd)
|
populate(M.Tree.entries, M.Tree.cwd)
|
||||||
|
|
||||||
local stat = luv.fs_stat(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
|
if #node.entries > 0 then
|
||||||
renderer.draw(M.Tree, true)
|
renderer.draw(M.Tree, true)
|
||||||
else
|
else
|
||||||
git.git_root(node.absolute_path)
|
if config.use_git() then
|
||||||
|
git.git_root(node.absolute_path)
|
||||||
|
end
|
||||||
populate(node.entries, node.link_to or node.absolute_path, node)
|
populate(node.entries, node.link_to or node.absolute_path, node)
|
||||||
|
|
||||||
renderer.draw(M.Tree, true)
|
renderer.draw(M.Tree, true)
|
||||||
|
|||||||
@@ -354,7 +354,9 @@ function M.populate(entries, cwd, parent_node)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.schedule(function() git.update_status(entries, cwd, parent_node) end)
|
if config.use_git() then
|
||||||
|
vim.schedule(function() git.update_status(entries, cwd, parent_node) end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
Reference in New Issue
Block a user