Files
neovim/runtime/lua/vim/_meta
Justin M. Keyes d8a8825679 feat(lua): vim.wait() returns callback results #35588
Problem:
The callback passed to `vim.wait` cannot return results directly, it
must set upvalues or globals.

    local rv1, rv2, rv3
    local ok = vim.wait(200, function()
      rv1, rv2, rv3 = 'a', 42, { ok = { 'yes' } }
      return true
    end)

Solution:
Let the callback return values after the first "status" result.

    local ok, rv1, rv2, rv3 = vim.wait(200, function()
      return true, 'a', 42, { ok = { 'yes' } }
    end)
2025-09-01 13:26:46 -07:00
..
2025-06-06 15:36:48 +01:00
2025-07-07 18:56:22 -07:00
2025-01-01 12:29:51 -08:00
2024-07-15 21:16:29 +01:00
2024-02-27 14:41:17 +00:00
2024-05-15 23:19:26 +02:00