feat(ai): added completion hooks for next edit suggestions

This commit is contained in:
Folke Lemaitre
2025-09-26 15:57:00 +02:00
parent b25ea9c153
commit 30a325d671
4 changed files with 3 additions and 5 deletions

View File

@@ -49,7 +49,6 @@ map("n", "<leader>bD", "<cmd>:bd<cr>", { desc = "Delete Buffer and Window" })
map({ "i", "n", "s" }, "<esc>", function()
vim.cmd("noh")
LazyVim.cmp.actions.snippet_stop()
LazyVim.cmp.actions.ai_stop()
return "<esc>"
end, { expr = true, desc = "Escape and Clear hlsearch" })

View File

@@ -122,12 +122,12 @@ return {
if opts.keymap.preset == "super-tab" then -- super-tab
opts.keymap["<Tab>"] = {
require("blink.cmp.keymap.presets").get("super-tab")["<Tab>"][1],
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }),
"fallback",
}
else -- other presets
opts.keymap["<Tab>"] = {
LazyVim.cmp.map({ "snippet_forward", "ai_accept" }),
LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }),
"fallback",
}
end

View File

@@ -52,7 +52,7 @@ return {
fallback()
end,
["<tab>"] = function(fallback)
return LazyVim.cmp.map({ "snippet_forward", "ai_accept" }, fallback)()
return LazyVim.cmp.map({ "snippet_forward", "ai_nes", "ai_accept" }, fallback)()
end,
}),
sources = cmp.config.sources({

View File

@@ -18,7 +18,6 @@ M.actions = {
vim.snippet.stop()
end
end,
ai_stop = function() end,
}
---@param actions string[]