fix(nvim): make blink.cmp correctly complete command line

This commit is contained in:
Price Hiller 2024-12-22 17:17:54 -06:00
parent 8f354c69ea
commit 84d3d2ac6d
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB

View File

@ -50,7 +50,24 @@ return {
preset = "default",
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
["<C-e>"] = { "hide", "fallback" },
["<C-CR>"] = { "accept", "fallback" },
["<CR>"] = {
function(cmp)
if vim.api.nvim_get_mode().mode:lower() == "c" then
return cmp.select_and_accept({
callback = function()
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes("<CR>", true, true, true),
"n",
true
)
end,
})
else
return cmp.accept()
end
end,
"fallback",
},
["<C-Tab>"] = {
function(cmp)
if cmp.snippet_active() then