mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 03:14:55 +02:00
nvim/lua/user/utils/cmp.lua: format fix
This commit is contained in:
parent
700b2aa5e5
commit
718f803be2
1 changed files with 29 additions and 29 deletions
|
|
@ -4,41 +4,41 @@ local cmp = require("cmp")
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
function M.selectNext(opts)
|
function M.selectNext(opts)
|
||||||
return cmp.mapping(function(fallback)
|
return cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item(opts or {})
|
cmp.select_next_item(opts or {})
|
||||||
elseif hasluansp and luasnip.locally_jumpable(1) then
|
elseif hasluansp and luasnip.locally_jumpable(1) then
|
||||||
luasnip.jump(1)
|
luasnip.jump(1)
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" })
|
end, { "i", "s" })
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.selectPrev(opts)
|
function M.selectPrev(opts)
|
||||||
return cmp.mapping(function(fallback)
|
return cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item(opts or {})
|
cmp.select_prev_item(opts or {})
|
||||||
elseif hasluansp and luasnip.locally_jumpable(-1) then
|
elseif hasluansp and luasnip.locally_jumpable(-1) then
|
||||||
luasnip.jump(-1)
|
luasnip.jump(-1)
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" })
|
end, { "i", "s" })
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.confirm(opts)
|
function M.confirm(opts)
|
||||||
return cmp.mapping(function(fallback)
|
return cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
-- if luasnip.expand_or_jumpable() then
|
-- if luasnip.expand_or_jumpable() then
|
||||||
-- luasnip.expand_or_jump()
|
-- luasnip.expand_or_jump()
|
||||||
-- else
|
-- else
|
||||||
cmp.confirm(opts or {})
|
cmp.confirm(opts or {})
|
||||||
-- end
|
-- end
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue