From 843c1bed95d35f7c6081857fc8ce237f3823d6a1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 2 Jun 2023 17:23:45 +0800 Subject: [PATCH] fix(health): stop job properly on timeout (#23877) --- runtime/lua/provider/health.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/lua/provider/health.lua b/runtime/lua/provider/health.lua index 3a60e38fe5..e0bfe57cb6 100644 --- a/runtime/lua/provider/health.lua +++ b/runtime/lua/provider/health.lua @@ -109,13 +109,13 @@ local function system(cmd, ...) end if not is_blank(stdin) then - vim.cmd([[call jobsend(jobid, stdin)]]) + vim.api.nvim_chan_send(jobid, stdin) end local res = vim.fn.jobwait({ jobid }, 30000) if res[1] == -1 then error('Command timed out: ' .. shellify(cmd)) - vim.cmd([[call jobstop(jobid)]]) + vim.fn.jobstop(jobid) elseif shell_error() and not ignore_error then local emsg = 'Command error (job=' .. jobid