diff options
| author | Opportunity <[email protected]> | 2020-01-20 20:30:31 +0800 |
|---|---|---|
| committer | Opportunity <[email protected]> | 2020-01-20 22:21:47 +0800 |
| commit | 3364333877dc8a579f08b54099fda653948e07ab (patch) | |
| tree | 2c2d5b6dabd5937827f9ae0cbc511b8a2f16f5d4 /xmake/core/theme/theme.lua | |
| parent | 5f96933d1ad672cc5b29df88a78b32ff4cdd3ebc (diff) | |
improve tab complete
Diffstat (limited to 'xmake/core/theme/theme.lua')
| -rw-r--r-- | xmake/core/theme/theme.lua | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/xmake/core/theme/theme.lua b/xmake/core/theme/theme.lua index 6244edd5f..adf5024fb 100644 --- a/xmake/core/theme/theme.lua +++ b/xmake/core/theme/theme.lua @@ -96,7 +96,21 @@ function theme.directories() return dirs end --- load the given theme +-- find all themes +function theme.names() + + local paths = {} + for _, dir in ipairs(theme.directories()) do + table.join2(paths, (os.match(path.join(dir, "*", "xmake.lua"), "f"))) + end + for i, v in ipairs(paths) do + local value = path.split(v) + paths[i] = value[#value - 1] + end + return paths +end + +-- load the given theme function theme.load(name) -- find the theme script path |
