diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-09-20 22:03:16 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2022-09-22 10:38:11 +0200 |
commit | 02f8ca59a80cd3570593c717ff6ceadc33239b89 (patch) | |
tree | ffe2148ab3193f2c122ed43e9655e3179b17c1e5 /runtime/lua/man.lua | |
parent | 93b30582db520ae20d66b000053007c11b62c15d (diff) | |
download | rneovim-02f8ca59a80cd3570593c717ff6ceadc33239b89.tar.gz rneovim-02f8ca59a80cd3570593c717ff6ceadc33239b89.tar.bz2 rneovim-02f8ca59a80cd3570593c717ff6ceadc33239b89.zip |
fix(tests): indicate in test logs when nvim exit times out
When it happens it wastes 2 seconds which is NOT included in the
normal busted timing info. It is hard to correct this, but we
can at least print a warning when this happens.
Diffstat (limited to 'runtime/lua/man.lua')
-rw-r--r-- | runtime/lua/man.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua index f0306f4871..88535321ac 100644 --- a/runtime/lua/man.lua +++ b/runtime/lua/man.lua @@ -21,13 +21,15 @@ local function man_system(cmd, silent) local done = false local exit_code - local handle = vim.loop.spawn(cmd[1], { + local handle + handle = vim.loop.spawn(cmd[1], { args = vim.list_slice(cmd, 2), stdio = { nil, stdout, stderr }, }, function(code) exit_code = code stdout:close() stderr:close() + handle:close() done = true end) @@ -52,7 +54,7 @@ local function man_system(cmd, silent) if not done then if handle then - vim.loop.shutdown(handle) + handle:close() stdout:close() stderr:close() end |