Skip to content

Commit d7516ae

Browse files
authored
fix(windows): By not setting detached = true, we prevent Windows from creating a separate window for markmap, as windows don't have the concept of daemons. Instead of registering a service, we just let Neovim take take of the subprocess.
1 parent ded391d commit d7516ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/markmap/init.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,23 @@ M.setup = function(ctx)
6464
reset_arguments()
6565
table.insert(arguments, vim.fn.expand "%:p") -- current buffer path
6666
if job ~= nil then uv.process_kill(job, 9) end
67-
job = uv.spawn(run_markmap, { args = arguments, detached = true }, nil)
67+
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
7474
if job ~= nil then uv.process_kill(job, 9) end -- kill -9 jobs
75-
job = uv.spawn(run_markmap, { args = arguments, detached = true }, nil)
75+
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
8282
if job ~= nil then uv.process_kill(job, 9) end
83-
job = uv.spawn(run_markmap, { args = arguments, detached = true }, nil)
83+
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
)

0 commit comments

Comments
 (0)