From 235f113895c6351b4edf911f7f8e66d393c18f16 Mon Sep 17 00:00:00 2001 From: Zeioth Date: Thu, 15 Feb 2024 16:18:32 +0100 Subject: [PATCH] =?UTF-8?q?fix(windows):=20`uv.process=5Fkill(job)`=20don'?= =?UTF-8?q?t=20kill=20jobs=20correctly=20on=20windows=20when=20you=20speci?= =?UTF-8?q?fy=20the=20priority=20=E2=86=92=20Neovim=20bug=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/markmap/init.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/markmap/init.lua b/lua/markmap/init.lua index d245b0f..8492331 100644 --- a/lua/markmap/init.lua +++ b/lua/markmap/init.lua @@ -63,7 +63,7 @@ M.setup = function(ctx) cmd("MarkmapOpen", function() reset_arguments() table.insert(arguments, vim.fn.expand "%:p") -- current buffer path - if job ~= nil then uv.process_kill(job, 9) end + if job ~= nil then uv.process_kill(job) end job = uv.spawn(run_markmap, { args = arguments }, nil) end, { desc = "Show a mental map of the current file" }) @@ -71,7 +71,7 @@ M.setup = function(ctx) reset_arguments() table.insert(arguments, "--no-open") -- specific to this command table.insert(arguments, vim.fn.expand "%:p") -- current buffer path - if job ~= nil then uv.process_kill(job, 9) end -- kill -9 jobs + if job ~= nil then uv.process_kill(job) end -- kill jobs job = uv.spawn(run_markmap, { args = arguments }, nil) end, { desc = "Save the HTML file without opening the mindmap" }) @@ -79,14 +79,14 @@ M.setup = function(ctx) reset_arguments() table.insert(arguments, "--watch") -- spetific to this command table.insert(arguments, vim.fn.expand "%:p") -- current buffer path - if job ~= nil then uv.process_kill(job, 9) end + if job ~= nil then uv.process_kill(job) end job = uv.spawn(run_markmap, { args = arguments }, nil) end, { desc = "Show a mental map of the current file and watch for changes" } ) cmd("MarkmapWatchStop", function() - if job ~= nil then uv.process_kill(job, 9) end -- kill -9 jobs + if job ~= nil then uv.process_kill(job) end -- kill jobs end, { desc = "Manually stops markmap watch" }) -- Autocmds -------------------------------------------------------------- @@ -105,7 +105,7 @@ M.setup = function(ctx) -- Otherwise, use grace_period local current_time = uv.now() if current_time - last_execution >= grace_period then -- if grace period exceeded - if job ~= nil then uv.process_kill(job, 9) end -- pkill -9 jobs + if job ~= nil then uv.process_kill(job) end -- pkill jobs last_execution = current_time -- update time end end, @@ -116,7 +116,7 @@ M.setup = function(ctx) desc = "Kill all markmap jobs before closing nvim", group = augroup("markmap_kill_pre_exit_nvim", { clear = true }), callback = function() - if job ~= nil then uv.process_kill(job, 9) end -- kill -9 jobs + if job ~= nil then uv.process_kill(job) end -- kill jobs end, }) end