feat: custom slash commands (#1826)

This commit is contained in:
yetone
2025-04-07 22:19:59 +08:00
committed by GitHub
parent 1c36cfc812
commit d76a158b61
10 changed files with 306 additions and 216 deletions

View File

@@ -292,28 +292,6 @@ function Selection:create_editing_input(request, line1, line2)
self.prompt_input = prompt_input
prompt_input:open()
api.nvim_create_autocmd("InsertEnter", {
group = self.augroup,
buffer = prompt_input.bufnr,
once = true,
desc = "Setup the completion of helpers in the input buffer",
callback = function()
local has_cmp, cmp = pcall(require, "cmp")
if has_cmp then
cmp.register_source(
"avante_mentions",
require("cmp_avante.mentions"):new(Utils.get_mentions(), prompt_input.bufnr)
)
cmp.setup.buffer({
enabled = true,
sources = {
{ name = "avante_mentions" },
},
})
end
end,
})
end
function Selection:setup_autocmds()