feat: support acp slash commands (#2775)

This commit is contained in:
yetone
2025-10-16 19:05:57 +08:00
committed by GitHub
parent 216ba4a8b2
commit 487972386e
8 changed files with 107 additions and 33 deletions

View File

@@ -1626,7 +1626,22 @@ function M.get_commands()
)
:totable()
return vim.list_extend(builtin_commands, Config.slash_commands)
local commands = {}
local seen = {}
for _, command in ipairs(Config.slash_commands) do
if not seen[command.name] then
table.insert(commands, command)
seen[command.name] = true
end
end
for _, command in ipairs(builtin_commands) do
if not seen[command.name] then
table.insert(commands, command)
seen[command.name] = true
end
end
return commands
end
function M.get_timestamp() return tostring(os.date("%Y-%m-%d %H:%M:%S")) end