summaryrefslogtreecommitdiff
path: root/xmake/plugins/check/checker.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-02 22:37:35 +0800
committerruki <[email protected]>2023-02-02 22:37:35 +0800
commit7f8eefb8a113cdf8881aa3ed1c4cd4caa1ffb981 (patch)
tree0fb39b271e9867940b9a230c7f82885f8bf31667 /xmake/plugins/check/checker.lua
parent058c743ec6da396c2d28d99cd2838b0528ead682 (diff)
improve list
Diffstat (limited to 'xmake/plugins/check/checker.lua')
-rw-r--r--xmake/plugins/check/checker.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/plugins/check/checker.lua b/xmake/plugins/check/checker.lua
index bd938d1ac..0f003537c 100644
--- a/xmake/plugins/check/checker.lua
+++ b/xmake/plugins/check/checker.lua
@@ -51,11 +51,15 @@ function complete(complete, opt)
{
function ()
local list = {}
+ local groupstats = {}
for name, _ in table.orderpairs(checkers()) do
+ local groupname = name:split(".", {plain = true})[1]
+ groupstats[groupname] = (groupstats[groupname] or 0) + 1
if not complete then
- if #list < 16 then
+ local limit = 16
+ if groupstats[groupname] < limit then
table.insert(list, name)
- else
+ elseif groupstats[groupname] == limit then
table.insert(list, "...")
end
elseif name:startswith(complete) then