We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 044c54b commit b3457efCopy full SHA for b3457ef
lua/opencode/promise.lua
@@ -197,7 +197,7 @@ function Promise:finally(callback)
197
-- Ignore callback errors and result, finally doesn't change the promise chain
198
if not ok then
199
-- Log error but don't propagate it
200
- vim.notify("Error in finally callback", vim.log.levels.WARN)
+ vim.notify('Error in finally callback', vim.log.levels.WARN)
201
end
202
203
@@ -374,9 +374,11 @@ end
374
---@return fun(...): Promise<T>
375
function Promise.async(fn)
376
return function(...)
377
+ -- Capture both args and count to handle nil values correctly
378
+ local n = select('#', ...)
379
local args = { ... }
380
return Promise.spawn(function()
- return fn(unpack(args))
381
+ return fn(unpack(args, 1, n))
382
end)
383
384
0 commit comments