fix cmp use new function

This commit is contained in:
max397574 2021-10-08 15:26:20 +02:00 committed by siduck76
parent 40554c80ad
commit 8a426b9e62
1 changed files with 4 additions and 4 deletions

View File

@ -44,7 +44,7 @@ cmp.setup {
}, },
["<Tab>"] = function(fallback) ["<Tab>"] = function(fallback)
if cmp.visible() then if cmp.visible() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-n>", true, true, true), "n") cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "") vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
else else
@ -53,7 +53,7 @@ cmp.setup {
end, end,
["<S-Tab>"] = function(fallback) ["<S-Tab>"] = function(fallback)
if cmp.visible() then if cmp.visible() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-p>", true, true, true), "n") cmp.select_next_item()
elseif require("luasnip").jumpable(-1) then elseif require("luasnip").jumpable(-1) then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "") vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
else else