fix: call vimL function in main loop (#206)

This commit is contained in:
Steven Arcangeli 2023-10-28 11:02:05 -07:00
parent 4088efb8ff
commit 8418e94734

View file

@ -13,20 +13,23 @@ local FIELD_NAME = constants.FIELD_NAME
local FIELD_META = constants.FIELD_META local FIELD_META = constants.FIELD_META
local function read_link_data(path, cb) local function read_link_data(path, cb)
uv.fs_readlink(path, function(link_err, link) uv.fs_readlink(
if link_err then path,
cb(link_err) vim.schedule_wrap(function(link_err, link)
else if link_err then
assert(link) cb(link_err)
local stat_path = link else
if not fs.is_absolute(link) then assert(link)
stat_path = fs.join(vim.fn.fnamemodify(path, ":h"), link) local stat_path = link
if not fs.is_absolute(link) then
stat_path = fs.join(vim.fn.fnamemodify(path, ":h"), link)
end
uv.fs_stat(stat_path, function(stat_err, stat)
cb(nil, link, stat)
end)
end end
uv.fs_stat(stat_path, function(stat_err, stat) end)
cb(nil, link, stat) )
end)
end
end)
end end
---@param path string ---@param path string