Skip to content

Commit b31003e

Browse files
committed
chore(git): schedule status update and redraw when git status update is done
1 parent c1b112f commit b31003e

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

Diff for: lua/nvim-tree/git.lua

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ function M.update_status(entries, cwd, parent_node)
148148
end
149149
end
150150
end
151+
require'nvim-tree.lib'.redraw()
151152
end
152153

153154
---Check if the given path is ignored by git.

Diff for: lua/nvim-tree/lib.lua

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ function M.init(with_open, with_reload)
5151
end
5252
end
5353

54+
function M.redraw()
55+
renderer.draw(M.Tree, true)
56+
end
57+
5458
local function get_node_at_line(line)
5559
local index = 2
5660
local function iter(entries)

Diff for: lua/nvim-tree/populate.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ function M.populate(entries, cwd, parent_node)
343343
return
344344
end
345345

346-
git.update_status(entries, cwd, parent_node)
346+
vim.schedule(function() git.update_status(entries, cwd, parent_node) end)
347347
end
348348

349349
return M

0 commit comments

Comments
 (0)