Skip to content

Commit 28c9cdd

Browse files
authored
feat(async): enable to wrap uv.fs_opendir() (#625)
1 parent 1a0bb83 commit 28c9cdd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lua/plenary/async/uv_async.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ local uv = vim.loop
33

44
local M = {}
55

6-
local function add(name, argc)
7-
local success, ret = pcall(a.wrap, uv[name], argc)
6+
local function add(name, argc, custom)
7+
local success, ret = pcall(a.wrap, custom or uv[name], argc)
88

99
if not success then
1010
error("Failed to add function with name " .. name)
@@ -48,7 +48,9 @@ add("fs_chown", 4)
4848
add("fs_fchown", 4)
4949
-- 'fs_lchown',
5050
add("fs_copyfile", 4)
51-
-- add('fs_opendir', 3) -- TODO: fix this one
51+
add("fs_opendir", 3, function(path, entries, callback)
52+
return uv.fs_opendir(path, callback, entries)
53+
end)
5254
add("fs_readdir", 2)
5355
add("fs_closedir", 2)
5456
-- 'fs_statfs',

0 commit comments

Comments
 (0)