mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 10:40:04 +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
|
end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
|
local function ctrl_p(f) -- {{{
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
else
|
||||||
|
pcall(f)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- }}}
|
||||||
|
|
||||||
local function ctrl_n(f) -- {{{
|
local function ctrl_n(f) -- {{{
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
@ -93,7 +102,8 @@ cmp.setup({
|
|||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
['<C-n'] = ctrl_n,
|
['<C-n>'] = ctrl_n,
|
||||||
|
['<C-p>'] = ctrl_p,
|
||||||
['<CR>'] = enter,
|
['<CR>'] = enter,
|
||||||
},
|
},
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
|
Loading…
Reference in New Issue
Block a user