@@ -18,31 +18,34 @@ M.setup = function(opts)
18
18
cmd (" MarkmapOpen" , function ()
19
19
config = vim .g .markmap_config
20
20
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 )
22
23
if job ~= nil then jobstop (job ) end
23
24
job = jobstart (config .markmap_cmd , arguments )
24
25
end , { desc = " Show a mental map of the current file" })
25
26
26
27
cmd (" MarkmapSave" , function ()
27
28
config = vim .g .markmap_config
28
29
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
32
34
job = jobstart (config .markmap_cmd , arguments )
33
35
end , { desc = " Save the HTML file without opening the mindmap" })
34
36
35
37
cmd (" MarkmapWatch" , function ()
36
38
config = vim .g .markmap_config
37
39
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
41
44
job = jobstart (config .markmap_cmd , arguments )
42
45
end , { desc = " Show a mental map of the current file and watch for changes" })
43
46
44
47
cmd (" MarkmapWatchStop" , function ()
45
- if job ~= nil then jobstop (job ) end -- kill jobs
48
+ if job ~= nil then jobstop (job ) end -- kill jobs
46
49
end , { desc = " Manually stops markmap watch" })
47
50
48
51
-- Autocmds -----------------------------------------------------------------
0 commit comments