Be more lenient with appending `PATHSEP` in `common.path_suggest` in Windows
This allows to use the Unix separator without resulting in ugly suggestions that added the Windows separator too. For example: Before: `data/` -> `data/\core\` After: `data/` -> `data/core\`
This commit is contained in:
parent
e8ca861512
commit
4c186b07a3
|
@ -164,7 +164,9 @@ function common.path_suggest(text, root)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if path:sub(-1) ~= PATHSEP then
|
-- Only in Windows allow using both styles of PATHSEP
|
||||||
|
if (PATHSEP == "\\" and not string.match(path:sub(-1), "[\\/]")) or
|
||||||
|
(PATHSEP ~= "\\" and path:sub(-1) ~= PATHSEP) then
|
||||||
path = path .. PATHSEP
|
path = path .. PATHSEP
|
||||||
end
|
end
|
||||||
local files = system.list_dir(path) or {}
|
local files = system.list_dir(path) or {}
|
||||||
|
|
Loading…
Reference in New Issue