Skip to content

Commit 235f113

Browse files
committed
fix(windows): uv.process_kill(job) don't kill jobs correctly on windows when you specify the priority → Neovim bug?
1 parent d7516ae commit 235f113

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lua/markmap/init.lua

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,30 +63,30 @@ M.setup = function(ctx)
6363
cmd("MarkmapOpen", function()
6464
reset_arguments()
6565
table.insert(arguments, vim.fn.expand "%:p") -- current buffer path
66-
if job ~= nil then uv.process_kill(job, 9) end
66+
if job ~= nil then uv.process_kill(job) end
6767
job = uv.spawn(run_markmap, { args = arguments }, nil)
6868
end, { desc = "Show a mental map of the current file" })
6969

7070
cmd("MarkmapSave", function()
7171
reset_arguments()
7272
table.insert(arguments, "--no-open") -- specific to this command
7373
table.insert(arguments, vim.fn.expand "%:p") -- current buffer path
74-
if job ~= nil then uv.process_kill(job, 9) end -- kill -9 jobs
74+
if job ~= nil then uv.process_kill(job) end -- kill jobs
7575
job = uv.spawn(run_markmap, { args = arguments }, nil)
7676
end, { desc = "Save the HTML file without opening the mindmap" })
7777

7878
cmd("MarkmapWatch", function()
7979
reset_arguments()
8080
table.insert(arguments, "--watch") -- spetific to this command
8181
table.insert(arguments, vim.fn.expand "%:p") -- current buffer path
82-
if job ~= nil then uv.process_kill(job, 9) end
82+
if job ~= nil then uv.process_kill(job) end
8383
job = uv.spawn(run_markmap, { args = arguments }, nil)
8484
end,
8585
{ desc = "Show a mental map of the current file and watch for changes" }
8686
)
8787

8888
cmd("MarkmapWatchStop", function()
89-
if job ~= nil then uv.process_kill(job, 9) end -- kill -9 jobs
89+
if job ~= nil then uv.process_kill(job) end -- kill jobs
9090
end, { desc = "Manually stops markmap watch" })
9191

9292
-- Autocmds --------------------------------------------------------------
@@ -105,7 +105,7 @@ M.setup = function(ctx)
105105
-- Otherwise, use grace_period
106106
local current_time = uv.now()
107107
if current_time - last_execution >= grace_period then -- if grace period exceeded
108-
if job ~= nil then uv.process_kill(job, 9) end -- pkill -9 jobs
108+
if job ~= nil then uv.process_kill(job) end -- pkill jobs
109109
last_execution = current_time -- update time
110110
end
111111
end,
@@ -116,7 +116,7 @@ M.setup = function(ctx)
116116
desc = "Kill all markmap jobs before closing nvim",
117117
group = augroup("markmap_kill_pre_exit_nvim", { clear = true }),
118118
callback = function()
119-
if job ~= nil then uv.process_kill(job, 9) end -- kill -9 jobs
119+
if job ~= nil then uv.process_kill(job) end -- kill jobs
120120
end,
121121
})
122122
end

0 commit comments

Comments
 (0)