Add cmp.mapping.abort

This commit is contained in:
hrsh7th
2021-08-25 17:14:32 +09:00
parent 61eb3e0f10
commit 79601cb3db
3 changed files with 22 additions and 0 deletions

View File

@@ -48,6 +48,18 @@ cmp.close = function()
end
end
---Abort current completion
cmp.abort = function()
if vim.fn.pumvisible() == 1 then
keymap.feedkeys(keymap.t('<C-e>'), 'n', function()
core.reset()
end)
return true;
else
return false
end
end
---Select next item if possible
cmp.select_next_item = function()
if vim.fn.pumvisible() == 1 then