From 6b1da29c144142e2b56bbb7f9dca96b3ddb0b554 Mon Sep 17 00:00:00 2001 From: Matt Leong Date: Fri, 22 Oct 2021 17:56:55 -0700 Subject: [PATCH] fix(autocomplete): disable cmp cr mapping that was messing with autopairs --- lua/cosmic/lsp/autocomplete.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lua/cosmic/lsp/autocomplete.lua b/lua/cosmic/lsp/autocomplete.lua index 4673c30..d008cc9 100644 --- a/lua/cosmic/lsp/autocomplete.lua +++ b/lua/cosmic/lsp/autocomplete.lua @@ -21,10 +21,11 @@ cmp.setup({ [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.close(), - [''] = cmp.mapping.confirm({ + -- disabled for autopairs mapping + --[[ [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, - }), + }), ]] [''] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() @@ -59,13 +60,13 @@ cmp.setup({ experimental = { ghost_text = true, }, - sources = { + sources = cmp.config.sources({ { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'buffer' }, { name = 'nvim_lua' }, + { name = 'buffer' }, + { name = 'luasnip' }, { name = 'path' }, - }, + }), formatting = { format = require('lspkind').cmp_format({ with_text = true,