From 62599e1e1cc9f508ac92e718b68b5e96099d552b Mon Sep 17 00:00:00 2001 From: Kirk Paradis <77372584+parK-dev@users.noreply.github.com> Date: Sun, 9 Apr 2023 05:05:30 +0900 Subject: [PATCH] feat(completion): improve copilot-cmp defaults (#129) feat: improve copilot-cmp defaults by re-enabling C-e to turn off cmp window to see hidden copilot suggestion and add C-x and C-z mappings to go to next and previous copilot suggestions --- .../copilot-lua-cmp/copilot-lua-cmp.lua | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/lua/astrocommunity/completion/copilot-lua-cmp/copilot-lua-cmp.lua b/lua/astrocommunity/completion/copilot-lua-cmp/copilot-lua-cmp.lua index 0494c2e0e..9ad9fb596 100644 --- a/lua/astrocommunity/completion/copilot-lua-cmp/copilot-lua-cmp.lua +++ b/lua/astrocommunity/completion/copilot-lua-cmp/copilot-lua-cmp.lua @@ -30,22 +30,14 @@ return { fallback() end end, { "i", "s" }) - opts.mapping[""] = cmp.mapping { - i = function(fallback) - if copilot.is_visible() then - copilot.dismiss() - elseif not cmp.abort() then - fallback() - end - end, - c = function(fallback) - if copilot.is_visible() then - copilot.dismiss() - elseif not cmp.close() then - fallback() - end - end, - } + + opts.mapping[""] = cmp.mapping(function() + if copilot.is_visible() then copilot.next() end + end) + + opts.mapping[""] = cmp.mapping(function() + if copilot.is_visible() then copilot.prev() end + end) return opts end,