Imporve luasnip Tab jump behaviour

pull/869/head
socialsmoker223 2 years ago committed by siduck
parent ef6ecab861
commit 1278a3b703

@ -37,7 +37,7 @@ local default = {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
["<Tab>"] = function(fallback)
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
@ -45,8 +45,8 @@ local default = {
else
fallback()
end
end,
["<S-Tab>"] = function(fallback)
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
@ -54,7 +54,7 @@ local default = {
else
fallback()
end
end,
end, { "i", "s" }),
},
sources = {
{ name = "nvim_lsp" },

Loading…
Cancel
Save