Skip to content

Commit 0b35632

Browse files
committed
✨feat: added support for paths with spaces
1 parent 570f626 commit 0b35632

7 files changed

Lines changed: 19 additions & 19 deletions

File tree

lua/dooku/backends/doxygen.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ M.open = function()
4545
.. "/"
4646
.. config.doxygen_docs_dir
4747
)
48-
local html_file = cwd .. "/" .. config.doxygen_html_file
48+
local html_file = utils.os_path(cwd .. "/" .. config.doxygen_html_file)
4949
local html_file_exists = vim.loop.fs_stat(html_file) and vim.loop.fs_stat(html_file).type == 'file' or false
5050

5151
if config.on_open_notification and html_file_exists then
@@ -57,7 +57,7 @@ M.open = function()
5757
end
5858

5959
if html_file_exists then
60-
job = jobstart(config.browser_cmd, { html_file }, { cwd = cwd })
60+
job = jobstart(config.browser_cmd, { '"' .. html_file .. '"' }, { cwd = cwd })
6161
end
6262
end
6363

@@ -79,15 +79,15 @@ M.auto_setup = function()
7979

8080
vim.notify(
8181
"Auto setup is enabled. Creating:\n"
82-
.. utils.os_path(cwd .. "/" .. config.doxygen_clone_to_dir .. "/Doxyfile")
82+
.. utils.os_path(cwd .. "/" .. config.doxygen_clone_to_dir .. "/Doxyfile", true)
8383
.. "\n\nYou can run the command now.",
8484
vim.log.levels.INFO, { title = "dooku.nvim" }
8585
)
8686

8787
jobstart("git", {
8888
"clone", "--single-branch", "--depth 1",
8989
config.doxygen_clone_config_repo,
90-
config.doxygen_clone_to_dir,
90+
'"' .. config.doxygen_clone_to_dir .. '"',
9191
config.doxygen_clone_cmd_post
9292
}, { cwd = cwd })
9393
end

lua/dooku/backends/jsdoc.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ M.open = function()
4444
.. "/"
4545
.. config.jsdoc_docs_dir
4646
)
47-
local html_file = cwd .. "/" .. config.jsdoc_html_file
47+
local html_file = utils.os_path(cwd .. "/" .. config.jsdoc_html_file)
4848
local html_file_exists = vim.loop.fs_stat(html_file) and vim.loop.fs_stat(html_file).type == 'file' or false
4949

5050
if config.on_open_notification and html_file_exists then
@@ -56,7 +56,7 @@ M.open = function()
5656
end
5757

5858
if html_file_exists then
59-
jobstart(config.browser_cmd, { html_file }, { cwd = cwd })
59+
jobstart(config.browser_cmd, { '"' .. html_file .. '"' }, { cwd = cwd })
6060
end
6161
end
6262

@@ -85,7 +85,7 @@ M.auto_setup = function()
8585
jobstart("git", {
8686
"clone", "--single-branch", "--depth 1",
8787
config.jsdoc_clone_config_repo,
88-
config.jsdoc_clone_to_dir,
88+
'"' .. config.jsdoc_clone_to_dir .. '"',
8989
config.jsdoc_clone_cmd_post
9090
}, { cwd = cwd })
9191
end

lua/dooku/backends/ldoc.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ M.open = function()
4444
.. "/"
4545
.. config.ldoc_docs_dir
4646
)
47-
local html_file = cwd .. "/" .. config.ldoc_html_file
47+
local html_file = utils.os_path(cwd .. "/" .. config.ldoc_html_file)
4848
local html_file_exists = vim.loop.fs_stat(html_file) and vim.loop.fs_stat(html_file).type == 'file' or false
4949

5050
if config.on_open_notification and html_file_exists then
@@ -56,7 +56,7 @@ M.open = function()
5656
end
5757

5858
if html_file_exists then
59-
jobstart(config.browser_cmd, { html_file }, { cwd = cwd })
59+
jobstart(config.browser_cmd, { '"' .. html_file .. '"' }, { cwd = cwd })
6060
end
6161
end
6262

@@ -85,7 +85,7 @@ M.auto_setup = function()
8585
jobstart("git", {
8686
"clone", "--single-branch", "--depth 1",
8787
config.ldoc_clone_config_repo,
88-
config.ldoc_clone_to_dir,
88+
'"' .. config.ldoc_clone_to_dir .. '"',
8989
config.ldoc_clone_cmd_post
9090
}, { cwd = cwd })
9191
end

lua/dooku/backends/rustdoc.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ M.open = function()
4242
.. "/"
4343
.. config.rustdoc_docs_dir
4444
)
45-
local html_file = cwd .. "/" .. crate_name .. "/" .. config.rustdoc_html_file
45+
local html_file = utils.os_path(cwd .. "/" .. crate_name .. "/" .. config.rustdoc_html_file)
4646
local html_file_exists = vim.loop.fs_stat(html_file) and vim.loop.fs_stat(html_file).type == 'file' or false
4747

4848
if config.on_open_notification and html_file_exists then
@@ -54,7 +54,7 @@ M.open = function()
5454
end
5555

5656
if html_file_exists then
57-
jobstart(config.browser_cmd, { html_file }, { cwd = cwd })
57+
jobstart(config.browser_cmd, { '"' .. html_file .. '"' }, { cwd = cwd })
5858
end
5959
end
6060

lua/dooku/backends/typedoc.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ M.open = function()
4444
.. "/"
4545
.. config.typedoc_docs_dir
4646
)
47-
local html_file = cwd .. "/" .. config.typedoc_html_file
47+
local html_file = utils.os_path(cwd .. "/" .. config.typedoc_html_file)
4848
local html_file_exists = vim.loop.fs_stat(html_file) and vim.loop.fs_stat(html_file).type == 'file' or false
4949

5050
if config.on_open_notification and html_file_exists then
@@ -56,7 +56,7 @@ M.open = function()
5656
end
5757

5858
if html_file_exists then
59-
jobstart(config.browser_cmd, { html_file }, { cwd = cwd })
59+
jobstart(config.browser_cmd, { '"' .. html_file .. '"' }, { cwd = cwd })
6060
end
6161
end
6262

@@ -85,7 +85,7 @@ M.auto_setup = function()
8585
jobstart("git", {
8686
"clone", "--single-branch", "--depth 1",
8787
config.typedoc_clone_config_repo,
88-
config.typedoc_clone_to_dir,
88+
'"' .. config.typedoc_clone_to_dir .. '"',
8989
config.typedoc_clone_cmd_post,
9090
}, { cwd = cwd })
9191
end

lua/dooku/backends/yard.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ M.open = function()
3636
.. "/"
3737
.. config.yard_docs_dir
3838
)
39-
local html_file = cwd .. "/" .. config.yard_html_file
39+
local html_file = utils.os_path(cwd .. "/" .. config.yard_html_file)
4040
local html_file_exists = vim.loop.fs_stat(html_file) and vim.loop.fs_stat(html_file).type == 'file' or false
4141

4242
if config.on_open_notification and html_file_exists then
@@ -48,7 +48,7 @@ M.open = function()
4848
end
4949

5050
if html_file_exists then
51-
jobstart(config.browser_cmd, { html_file }, { cwd = cwd })
51+
jobstart(config.browser_cmd, { '"' .. html_file .. '"' }, { cwd = cwd })
5252
end
5353
end
5454

lua/dooku/config.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function M.set(opts)
2626

2727
-- detect default internet browser
2828
if is_windows then
29-
M.browser_cmd = opts.browser_cmd or "start"
29+
M.browser_cmd = opts.browser_cmd or "iexplore.exe"
3030
else
3131
M.browser_cmd = opts.browser_cmd or "xdg-open"
3232
end
@@ -53,7 +53,7 @@ function M.set(opts)
5353
-- open './html/index.html' using the default interner browser.
5454
M.doxygen_docs_dir = opts.doxygen_htmldocs_dir or "doxygen"
5555
M.doxygen_html_file = opts.doxygen_html_file
56-
or utils.os_path "html/index.html"
56+
or utils.os_path("html/index.html")
5757

5858
-- Auto setup
5959
-- Defaults: clone the repo into 'doxygen'.

0 commit comments

Comments
 (0)