1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 22:50:06 +08:00

fix(cmp): fix key binding ctrl-n/p

This commit is contained in:
wsdjeg 2023-07-02 13:41:55 +08:00
parent d71c7bf640
commit 8e7a75944c

View File

@ -56,6 +56,15 @@ local function enter(f) -- {{{
end
-- }}}
local function ctrl_p(f) -- {{{
if cmp.visible() then
cmp.select_prev_item()
else
pcall(f)
end
end
-- }}}
local function ctrl_n(f) -- {{{
if cmp.visible() then
cmp.select_next_item()
@ -93,7 +102,8 @@ cmp.setup({
fallback()
end
end,
['<C-n'] = ctrl_n,
['<C-n>'] = ctrl_n,
['<C-p>'] = ctrl_p,
['<CR>'] = enter,
},
sources = cmp.config.sources({