fix: call vimL function in main loop (#206)
This commit is contained in:
parent
4088efb8ff
commit
8418e94734
1 changed files with 16 additions and 13 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue