Files
neovim/runtime/doc
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
..
2023-07-25 05:07:13 -07:00
2025-07-10 21:50:46 -04:00
2025-05-03 10:08:53 -07:00
2024-05-15 23:19:26 +02:00
2025-04-27 15:44:11 -07:00
2023-06-25 17:14:28 +02:00
2025-08-24 23:43:48 +00:00
2025-07-10 21:50:46 -04:00
2025-06-14 17:24:36 +02:00
2025-05-03 10:08:53 -07:00
2022-10-14 08:01:13 -07:00
2025-03-30 13:29:36 -07:00
2024-01-18 00:14:48 -08:00
2023-01-01 15:05:13 +01:00
2025-03-15 15:00:44 +01:00
2025-05-03 15:47:59 -07:00
2023-08-10 17:28:02 +08:00
2025-01-03 08:29:36 -08:00
2024-04-23 08:20:36 +08:00
2024-05-11 18:14:03 +08:00
2023-04-23 15:22:55 +02:00
2023-01-03 10:07:43 +00:00
2023-06-25 17:14:28 +02:00
2023-06-25 17:14:28 +02:00
2018-10-29 10:01:44 +01:00
2023-06-25 17:14:28 +02:00
2021-04-29 20:42:16 -04:00
2023-06-26 11:29:12 +02:00
2023-07-25 05:07:13 -07:00
2025-06-18 12:12:23 +02:00
2023-06-19 08:40:33 -07:00