wrap refresh logic in vim.schedule callback

This commit is contained in:
kiyan
2020-11-27 22:03:27 +01:00
committed by Kiyan
parent d3eb9cc4c6
commit ba4dac1e59

View File

@@ -118,6 +118,8 @@ local function refresh_nodes(node)
end end
function M.refresh_tree() function M.refresh_tree()
vim.schedule(
function ()
-- local stat = luv.fs_stat(M.Tree.cwd) -- local stat = luv.fs_stat(M.Tree.cwd)
-- if stat.mtime.sec ~= M.Tree.last_modified then -- if stat.mtime.sec ~= M.Tree.last_modified then
refresh_nodes(M.Tree) refresh_nodes(M.Tree)
@@ -131,6 +133,7 @@ function M.refresh_tree()
else else
M.Tree.loaded = false M.Tree.loaded = false
end end
end)
end end
function M.set_index_and_redraw(fname) function M.set_index_and_redraw(fname)