fix: new function to check for cmp completitions
This commit is contained in:
parent
5799af49e2
commit
40554c80ad
1 changed files with 2 additions and 2 deletions
|
@ -43,7 +43,7 @@ cmp.setup {
|
||||||
select = true,
|
select = true,
|
||||||
},
|
},
|
||||||
["<Tab>"] = function(fallback)
|
["<Tab>"] = function(fallback)
|
||||||
if vim.fn.pumvisible() == 1 then
|
if cmp.visible() then
|
||||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-n>", true, true, true), "n")
|
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-n>", true, true, true), "n")
|
||||||
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), "")
|
||||||
|
@ -52,7 +52,7 @@ cmp.setup {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
["<S-Tab>"] = function(fallback)
|
["<S-Tab>"] = function(fallback)
|
||||||
if vim.fn.pumvisible() == 1 then
|
if cmp.visible() then
|
||||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-p>", true, true, true), "n")
|
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<C-p>", true, true, true), "n")
|
||||||
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), "")
|
||||||
|
|
Loading…
Reference in a new issue