feat(util.mini): make mini.ai's which-key prompts consistent with user config, don't use hardcode

This commit is contained in:
Johnson Hu 2024-07-15 12:03:46 +08:00
parent e80ed322a7
commit 22d4e97215

View file

@ -92,14 +92,8 @@ function M.ai_whichkey()
}
local ret = { mode = { "o", "x" } }
for prefix, name in pairs({
i = "inside",
a = "around",
il = "last",
["in"] = "next",
al = "last",
an = "next",
}) do
local mappings = LazyVim.opts("mini.ai").mappings
for name, prefix in pairs(mappings) do
ret[#ret + 1] = { prefix, group = name }
for _, obj in ipairs(objects) do
local desc = obj.desc