aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/man.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/man.lua')
-rw-r--r--runtime/lua/man.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/lua/man.lua b/runtime/lua/man.lua
index 82ed0305f7..88535321ac 100644
--- a/runtime/lua/man.lua
+++ b/runtime/lua/man.lua
@@ -1,5 +1,3 @@
-require('vim.compat')
-
local api, fn = vim.api, vim.fn
local find_arg = '-w'
@@ -23,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)
@@ -54,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