Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions lua/gitlinker/async.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ end
--- @tparam any ... Arguments for func
--- @treturn async_t Handle
function M.run(func, callback, ...)
vim.validate({
func = { func, "function" },
callback = { callback, "function", true },
})
local co = coroutine.create(func)
local handle = Async_T.new(co)
local function step(...)
Expand Down Expand Up @@ -89,10 +85,6 @@ function M.run(func, callback, ...)
return handle
end
local function wait(argc, func, ...)
vim.validate({
argc = { argc, "number" },
func = { func, "function" },
})
-- Always run the wrapped functions in xpcall and re-raise the error in the
-- coroutine. This makes pcall work as normal.
local function pfunc(...)
Expand Down Expand Up @@ -133,10 +125,6 @@ end
--- @tparam boolean strict Error when called in non-async context
--- @treturn function(...):async_t
function M.create(func, argc, strict)
vim.validate({
func = { func, "function" },
argc = { argc, "number", true },
})
argc = argc or 0
return function(...)
if M.running() then
Expand All @@ -154,7 +142,6 @@ end
--- @tparam function func
--- @tparam boolean strict Error when called in non-async context
function M.void(func, strict)
vim.validate({ func = { func, "function" } })
return function(...)
if M.running() then
if strict then
Expand All @@ -172,9 +159,6 @@ end
--- @tparam boolean strict Error when called in non-async context
--- @treturn function Returns an async function
function M.wrap(func, argc, strict)
vim.validate({
argc = { argc, "number" },
})
return function(...)
if not M.running() then
if strict then
Expand Down