wrap refresh logic in vim.schedule callback
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user