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:
@@ -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 {}
|
||||||
|
|||||||
Reference in New Issue
Block a user