feat: improve snippet completion
parent
667b7a9db3
commit
9e2c4205d9
|
@ -13,9 +13,6 @@ cmp.setup({
|
|||
},
|
||||
}),
|
||||
},
|
||||
enabled = function()
|
||||
return not luasnip.jumpable(1)
|
||||
end,
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
|
@ -49,6 +46,8 @@ cmp.setup({
|
|||
["<C-n>"] = cmp.mapping(function(fallback)
|
||||
if luasnip.choice_active() then
|
||||
luasnip.change_choice(1)
|
||||
elseif luasnip.locally_jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
|
@ -56,6 +55,8 @@ cmp.setup({
|
|||
["<C-p>"] = cmp.mapping(function(fallback)
|
||||
if luasnip.choice_active() then
|
||||
luasnip.change_choice(-1)
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue