Skip to content

Commit 2e76bed

Browse files
authored
fix: Actually no we can't.
1 parent a6af873 commit 2e76bed

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lua/markmap/init.lua

+12-12
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ M.setup = function(ctx)
2020
-- Set default options
2121
if html_output == nil then
2222
if is_windows then
23-
html_output = uv.os_getenv "TEMP" .. "\\" .. "markmap.html"
23+
html_output = "TEMP" .. "\\" .. "markmap.html"
2424
elseif is_android then
2525
html_output = "/data/data/com.termux/files/usr/tmp/markmap.html"
2626
else -- unix
@@ -62,17 +62,17 @@ M.setup = function(ctx)
6262
-- Setup commands -----------------------------------------------------------
6363
cmd("MarkmapOpen", function()
6464
reset_arguments()
65-
table.insert(arguments, vim.fn.expand "%:p") -- current buffer path
65+
table.insert(arguments, vim.fn.expand "%:p") -- current buffer path
6666
if job ~= nil then jobstop(job) end
67-
job = jobstart(run_markmap, { args = arguments })
67+
job = jobstart { run_markmap, unpack(arguments) }
6868
end, { desc = "Show a mental map of the current file" })
6969

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

7878
cmd(
@@ -81,14 +81,14 @@ M.setup = function(ctx)
8181
reset_arguments()
8282
table.insert(arguments, "--watch") -- spetific to this command
8383
table.insert(arguments, vim.fn.expand "%:p") -- current buffer path
84-
if job ~= nil then jobstop(job) end -- kill jobs
85-
job = jobstart(run_markmap, {args = arguments })
84+
if job ~= nil then jobstop(job) end -- kill jobs
85+
job = jobstart { run_markmap, unpack(arguments) }
8686
end,
8787
{ desc = "Show a mental map of the current file and watch for changes" }
8888
)
8989

9090
cmd("MarkmapWatchStop", function()
91-
if job ~= nil then jobstop(job) end -- kill jobs
91+
if job ~= nil then jobstop(job) end -- kill jobs
9292
end, { desc = "Manually stops markmap watch" })
9393

9494
-- Autocmds -----------------------------------------------------------------
@@ -107,7 +107,7 @@ M.setup = function(ctx)
107107
-- Otherwise, use grace_period
108108
local current_time = uv.now()
109109
if current_time - last_execution >= grace_period then -- if grace period exceeded
110-
if job ~= nil then jobstop(job) end -- pkill jobs
110+
if job ~= nil then jobstop(job) end -- pkill jobs
111111
last_execution = current_time -- update time
112112
end
113113
end,
@@ -118,7 +118,7 @@ M.setup = function(ctx)
118118
desc = "Kill all markmap jobs before closing nvim",
119119
group = augroup("markmap_kill_pre_exit_nvim", { clear = true }),
120120
callback = function()
121-
if job ~= nil then jobstop(job) end -- kill jobs
121+
if job ~= nil then jobstop(job) end -- kill jobs
122122
end,
123123
})
124124
end

0 commit comments

Comments
 (0)