chore(git): schedule status update and redraw when git status update is done

This commit is contained in:
kiyan 2021-06-29 22:02:37 +02:00
parent c1b112f0ec
commit b31003e43a
3 changed files with 6 additions and 1 deletions

View File

@ -148,6 +148,7 @@ function M.update_status(entries, cwd, parent_node)
end
end
end
require'nvim-tree.lib'.redraw()
end
---Check if the given path is ignored by git.

View File

@ -51,6 +51,10 @@ function M.init(with_open, with_reload)
end
end
function M.redraw()
renderer.draw(M.Tree, true)
end
local function get_node_at_line(line)
local index = 2
local function iter(entries)

View File

@ -343,7 +343,7 @@ function M.populate(entries, cwd, parent_node)
return
end
git.update_status(entries, cwd, parent_node)
vim.schedule(function() git.update_status(entries, cwd, parent_node) end)
end
return M