Begin reworks of project manager

This commit is contained in:
Francesco Abbate
2020-12-07 18:06:58 +01:00
parent 48ad8a8392
commit a3adfeb8f6
2 changed files with 30 additions and 85 deletions
+15
View File
@@ -102,6 +102,21 @@ function common.path_suggest(text)
end
function common.dir_path_suggest(text)
local path, name = text:match("^(.-)([^/\\]*)$")
local files = system.list_dir(path == "" and "." or path) or {}
local res = {}
for _, file in ipairs(files) do
file = path .. file
local info = system.get_file_info(file)
if info and info.type == "dir" and file:lower():find(text:lower(), nil, true) == 1 then
table.insert(res, file)
end
end
return res
end
function common.match_pattern(text, pattern, ...)
if type(pattern) == "string" then
return text:find(pattern, ...)