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