Skip to content

Commit e821fdf

Browse files
committed
fix: The path we pass as argument to markpath is not automatically surrounded by "" so we must do it manually.
1 parent ba6abe5 commit e821fdf

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

lua/markmap/init.lua

+11-8
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,34 @@ M.setup = function(opts)
1818
cmd("MarkmapOpen", function()
1919
config = vim.g.markmap_config
2020
arguments = utils.reset_arguments()
21-
table.insert(arguments, vim.fn.expand("%:p")) -- current buffer path
21+
local path = '"' .. vim.fn.expand("%:p") .. '"' -- current buffer path
22+
table.insert(arguments, path)
2223
if job ~= nil then jobstop(job) end
2324
job = jobstart(config.markmap_cmd, arguments)
2425
end, { desc = "Show a mental map of the current file" })
2526

2627
cmd("MarkmapSave", function()
2728
config = vim.g.markmap_config
2829
arguments = utils.reset_arguments()
29-
table.insert(arguments, "--no-open") -- specific to this command
30-
table.insert(arguments, vim.fn.expand("%:p")) -- current buffer path
31-
if job ~= nil then jobstop(job) end -- kill jobs
30+
local path = '"' .. vim.fn.expand("%:p") .. '"' -- current buffer path
31+
table.insert(arguments, "--no-open") -- specific to this command
32+
table.insert(arguments, path)
33+
if job ~= nil then jobstop(job) end -- kill jobs
3234
job = jobstart(config.markmap_cmd, arguments)
3335
end, { desc = "Save the HTML file without opening the mindmap" })
3436

3537
cmd("MarkmapWatch", function()
3638
config = vim.g.markmap_config
3739
arguments = utils.reset_arguments()
38-
table.insert(arguments, "--watch") -- spetific to this command
39-
table.insert(arguments, vim.fn.expand("%:p")) -- current buffer path
40-
if job ~= nil then jobstop(job) end -- kill jobs
40+
local path = '"' .. vim.fn.expand("%:p") .. '"' -- current buffer path
41+
table.insert(arguments, "--watch") -- spetific to this command
42+
table.insert(arguments, path)
43+
if job ~= nil then jobstop(job) end -- kill jobs
4144
job = jobstart(config.markmap_cmd, arguments)
4245
end, { desc = "Show a mental map of the current file and watch for changes" })
4346

4447
cmd("MarkmapWatchStop", function()
45-
if job ~= nil then jobstop(job) end -- kill jobs
48+
if job ~= nil then jobstop(job) end -- kill jobs
4649
end, { desc = "Manually stops markmap watch" })
4750

4851
-- Autocmds -----------------------------------------------------------------

0 commit comments

Comments
 (0)