Replies: 2 comments
-
A possible way I can think of is to make a keybind calling ["<C-n>"] = cmp.mapping({
i = function()
if cmp.visible() then
cmp.select_next_item(select_only)
else
cmp.complete({
config = {
sources = {
{ name = 'luasnip_choice' },
},
},
})
end
end,
}),
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks. I actually came up with a conditioned solution: ["<C-Space>"] = cmp.mapping({
i = function(fallback)
local luasnip = require("luasnip")
if luasnip.choice_active() then
if not cmp.complete({
config = {
sources = {
{ name = "luasnip_choice" },
{ name = "luasnip" }
}
}
}) then
cmp.abort()
return fallback()
end
return
end
if not cmp.complete() then
cmp.abort()
luasnip.unlink_current()
return fallback()
end
end, But then I fixed |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. Is it possible to substitute/replace currently available sources DYNAMICALLY and then swap previous state back?
Possible use case is snippet's choices, like cmp-luasnip-choice. The latter provides sources that are polluted by other's completion.
Usually, in case of choices exact possible items are fixed. No need to complete anything else...
Beta Was this translation helpful? Give feedback.
All reactions