1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 11:24:55 +02:00

nvim/lua/user/utils/cmp.lua: format fix

This commit is contained in:
Henrik Hautakoski 2024-11-27 12:37:27 +01:00
parent 700b2aa5e5
commit 718f803be2

View file

@ -4,41 +4,41 @@ local cmp = require("cmp")
local M = {}
function M.selectNext(opts)
return cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item(opts or {})
elseif hasluansp and luasnip.locally_jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, { "i", "s" })
return cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item(opts or {})
elseif hasluansp and luasnip.locally_jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, { "i", "s" })
end
function M.selectPrev(opts)
return cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item(opts or {})
elseif hasluansp and luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" })
return cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item(opts or {})
elseif hasluansp and luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" })
end
function M.confirm(opts)
return cmp.mapping(function(fallback)
if cmp.visible() then
-- if luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
-- else
cmp.confirm(opts or {})
-- end
else
fallback()
end
end)
return cmp.mapping(function(fallback)
if cmp.visible() then
-- if luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
-- else
cmp.confirm(opts or {})
-- end
else
fallback()
end
end)
end
return M