mirror of
https://github.com/akinsho/toggleterm.nvim
synced 2024-09-16 21:34:03 +02:00
fix: cmd and path now work with paths containing spaces (#483)
This commit is contained in:
parent
c1b8f7eb62
commit
f059a52c3f
1 changed files with 8 additions and 1 deletions
|
@ -93,7 +93,14 @@ local term_exec_options = {
|
|||
local commands = {}
|
||||
|
||||
for _, path in ipairs(paths) do
|
||||
local glob_str = path .. "/" .. (typed_cmd or "") .. "*"
|
||||
local glob_str
|
||||
if string.match(path, "%s*") then
|
||||
--path with spaces
|
||||
glob_str = path:gsub(" ", "\\ ") .. "/" .. (typed_cmd or "") .. "*"
|
||||
else
|
||||
-- path without spaces
|
||||
glob_str = path .. "/" .. (typed_cmd or "") .. "*"
|
||||
end
|
||||
local dir_cmds = vim.split(vim.fn.glob(glob_str), "\n")
|
||||
|
||||
for _, cmd in ipairs(dir_cmds) do
|
||||
|
|
Loading…
Reference in a new issue