summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/private/xrepo/quick_search/cache.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/modules/private/xrepo/quick_search/cache.lua b/xmake/modules/private/xrepo/quick_search/cache.lua
index 43af417a8..a6d849341 100644
--- a/xmake/modules/private/xrepo/quick_search/cache.lua
+++ b/xmake/modules/private/xrepo/quick_search/cache.lua
@@ -105,7 +105,9 @@ function find(name, opt)
_init()
opt = opt or {}
local list_result = {}
- for cachekey, packagedata in pairs(cache:data()) do
+ -- @note we need to iterate them in a deterministic order, the caller may just take
+ -- the results as they come, e.g. the completion candidates
+ for cachekey, packagedata in table.orderpairs(cache:data()) do
-- we only search the packages with the given kind, e.g. nil (package), "addon"
local packagename = packagedata.name or cachekey
if packagedata.kind == opt.kind then