aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/coxpcall.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2024-09-12 03:04:33 +0200
committerJustin M. Keyes <justinkz@gmail.com>2025-01-03 19:24:04 +0100
commita1ba655dee0f89230ea09712e4df981cc3b15bea (patch)
tree190940a08a1886cd3eab005ed409f56897f1201f /runtime/lua/coxpcall.lua
parentfe87656f29e933b63f5d4dd03b3c0be3ed4ecf5f (diff)
downloadrneovim-a1ba655dee0f89230ea09712e4df981cc3b15bea.tar.gz
rneovim-a1ba655dee0f89230ea09712e4df981cc3b15bea.tar.bz2
rneovim-a1ba655dee0f89230ea09712e4df981cc3b15bea.zip
test: spawn_wait() starts a non-RPC Nvim process
Problem: Can't use `n.clear()` to test non-RPC `nvim` invocations. So tests end up creating ad-hoc wrappers around `system()` or `jobstart()`. Solution: - Introduce `n.spawn_wait()` - TODO (followup PR): Rename `n.spawn()` and `n.spawn_wait()`. It's misleading that `n.spawn()` returns a RPC session...
Diffstat (limited to 'runtime/lua/coxpcall.lua')
-rw-r--r--runtime/lua/coxpcall.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/lua/coxpcall.lua b/runtime/lua/coxpcall.lua
index 6b179f1ef0..75e7a43567 100644
--- a/runtime/lua/coxpcall.lua
+++ b/runtime/lua/coxpcall.lua
@@ -1,6 +1,10 @@
-------------------------------------------------------------------------------
+-- (Not needed for LuaJIT or Lua 5.2+)
+--
-- Coroutine safe xpcall and pcall versions
--
+-- https://keplerproject.github.io/coxpcall/
+--
-- Encapsulates the protected calls with a coroutine based loop, so errors can
-- be dealed without the usual Lua 5.x pcall/xpcall issues with coroutines
-- yielding inside the call to pcall or xpcall.