diff --git a/lua/rocks/search.lua b/lua/rocks/search.lua index 812c82b9..e9b41ed2 100644 --- a/lua/rocks/search.lua +++ b/lua/rocks/search.lua @@ -70,7 +70,12 @@ search.complete_versions = function(name, query) for _, rock in pairs(matching_rocks) do unique_versions[rock.version] = rock end - return vim.tbl_keys(unique_versions) + + local unique_keys = vim.tbl_keys(unique_versions) + table.sort(unique_keys, function(a, b) + return a > b + end) + return unique_keys end ---@param query string | nil