Skip to content

Commit

Permalink
fix: use uv.kill instead of vim.fn.jobclose
Browse files Browse the repository at this point in the history
  • Loading branch information
lopi-py committed Aug 14, 2024
1 parent ec1f20c commit 66a1c4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lua/conform/runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ M.format_async = function(bufnr, formatters, range, opts, callback)
-- kill previous jobs for buffer
local prev_jid = vim.b[bufnr].conform_jid
if prev_jid and opts.exclusive then
if vim.fn.jobstop(prev_jid) == 1 then
if uv.kill(prev_jid) == 0 then
log.info("Canceled previous format job for %s", vim.api.nvim_buf_get_name(bufnr))
end
end
Expand Down Expand Up @@ -610,7 +610,7 @@ M.format_sync = function(bufnr, formatters, timeout_ms, range, opts)
-- kill previous jobs for buffer
local prev_jid = vim.b[bufnr].conform_jid
if prev_jid and opts.exclusive then
if vim.fn.jobstop(prev_jid) == 1 then
if uv.kill(prev_jid) == 0 then
log.info("Canceled previous format job for %s", vim.api.nvim_buf_get_name(bufnr))
end
end
Expand Down Expand Up @@ -682,7 +682,7 @@ M.format_lines_sync = function(bufnr, formatters, timeout_ms, range, input_lines

if not wait_result then
if jid then
vim.fn.jobstop(jid)
uv.kill(jid)
end
if wait_reason == -1 then
return errors.coalesce(final_err, {
Expand Down

0 comments on commit 66a1c4b

Please sign in to comment.