mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 22:40:06 +08:00
fix(cmp): fix key binding ctrl-n/p
This commit is contained in:
parent
d71c7bf640
commit
8e7a75944c
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user