Skip to content

Commit

Permalink
fix windwp#92
Browse files Browse the repository at this point in the history
  • Loading branch information
windwp committed Aug 2, 2021
1 parent ad40d49 commit 775e143
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lua/nvim-autopairs/completion/compe.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local remap = vim.api.nvim_set_keymap
local npairs = require('nvim-autopairs')
local Completion = require('compe.completion')
local utils = require('nvim-autopairs.utils')
Expand Down Expand Up @@ -49,12 +48,18 @@ M.setup = function(opt)
local map_complete = opt.map_complete
vim.g.completion_confirm_key = ''
if map_cr then
remap('i', '<CR>', 'v:lua.MPairs.completion_confirm()', { expr = true, noremap = true })
vim.api.nvim_set_keymap(
'i', '<CR>', 'v:lua.MPairs.completion_confirm()',
{ expr = true, noremap = true }
)
end

if map_complete then
vim.cmd([[
augroup autopairs_compe
autocmd!
autocmd User CompeConfirmDone call v:lua.MPairs.completion_done()
augroup end
]])
end
end
Expand Down

0 comments on commit 775e143

Please sign in to comment.