This commit is contained in:
Dennis Frommknecht 2025-05-17 07:46:13 -07:00 committed by GitHub
commit c4cb6e3e92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 8 deletions

View file

@ -20,16 +20,22 @@ return {
"supermaven-inc/supermaven-nvim",
opts = function()
require("supermaven-nvim.completion_preview").suggestion_group = "SupermavenSuggestion"
LazyVim.cmp.actions.ai_accept = function()
local ai_accept = function(partial)
return function()
local suggestion = require("supermaven-nvim.completion_preview")
if suggestion.has_suggestion() then
LazyVim.create_undo()
vim.schedule(function()
suggestion.on_accept_suggestion()
suggestion.on_accept_suggestion(partial)
end)
return true
end
end
end
LazyVim.cmp.actions.ai_accept = ai_accept(false)
LazyVim.cmp.actions.ai_accept_word = ai_accept(true)
end,
},

View file

@ -88,6 +88,10 @@ return {
keymap = {
preset = "enter",
["<C-y>"] = { "select_and_accept" },
["<S-Tab>"] = {
LazyVim.cmp.map({ "snippet_backward", "ai_accept_word" }),
"fallback",
},
},
},
---@param opts blink.cmp.Config | { sources: { compat: string[] } }