Skip to content

Commit 01a0cbb

Browse files
committed
feat(utils): extended jobstart with opts
To handle that windows can't have multiple instances of markmapcli running I added a passthrough, so that I can handle appropreatly when markmapcli errors. I deregister autocmds and take the buffer from the watch list.
1 parent 478053d commit 01a0cbb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lua/markmap/utils.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ local is_windows = vim.uv.os_uname().sysname == "Windows_NT"
1212
--- the executables must be added to path in at windows level.
1313
---@param cmd string command to run.
1414
---@param arguments table arguments to pass to the cmd.
15+
---@param opts table vim.fn.jobstart options
1516
---@return number job pid of the job, so we can stop it later.
16-
M.jobstart = function(cmd, arguments)
17+
M.jobstart = function(cmd, arguments, opts)
1718
if is_windows then
18-
return vim.fn.jobstart({ cmd, unpack(arguments) })
19+
return vim.fn.jobstart({ cmd, unpack(arguments) }, opts)
1920
else
20-
return vim.fn.jobstart(cmd .. " " .. table.concat(arguments, " "))
21+
return vim.fn.jobstart(cmd .. " " .. table.concat(arguments, " "), opts)
2122
end
2223
end
2324

@@ -28,7 +29,7 @@ M.reset_arguments = function()
2829
local config = vim.g.markmap_config
2930

3031
local arguments = {}
31-
if config.html_output ~= "" then -- if html_output is "", don't pass the parameter
32+
if config.html_output ~= "" then -- if html_output is "", don't pass the parameter
3233
table.insert(arguments, "-o")
3334
table.insert(arguments, '"' .. config.html_output .. '"')
3435
end

0 commit comments

Comments
 (0)