Skip to content

Commit

Permalink
feat(async): enable to wrap uv.fs_opendir() (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
delphinus authored Feb 11, 2025
1 parent 1a0bb83 commit 28c9cdd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lua/plenary/async/uv_async.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ local uv = vim.loop

local M = {}

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

if not success then
error("Failed to add function with name " .. name)
Expand Down Expand Up @@ -48,7 +48,9 @@ add("fs_chown", 4)
add("fs_fchown", 4)
-- 'fs_lchown',
add("fs_copyfile", 4)
-- add('fs_opendir', 3) -- TODO: fix this one
add("fs_opendir", 3, function(path, entries, callback)
return uv.fs_opendir(path, callback, entries)
end)
add("fs_readdir", 2)
add("fs_closedir", 2)
-- 'fs_statfs',
Expand Down

0 comments on commit 28c9cdd

Please sign in to comment.