chore: prefer luasnip api methods over vim.fn.feedkeys in cmp's spec (#2930)

This commit is contained in:
gale 2024-07-16 02:24:36 -03:00 committed by GitHub
parent 231ec0ba72
commit b657b0ef84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -85,7 +85,7 @@ local options = {
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
require("luasnip").expand_or_jump()
else
fallback()
end
@ -95,7 +95,7 @@ local options = {
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
require("luasnip").jump(-1)
else
fallback()
end