jiangmiao/auto-pairs

hitiing <CR> at {|} doesn't making a new line

Closed this issue · 3 comments

when we hit at {|} the output should be like this ..
{
|
}

But for me it is not working like that , any suggestions ??

P.S. :- I am using nvim 0.5 with LSP and nvim-compe and completion nvim

What's the output of :verbose imap <CR>?

The bug was with completion-nvim ...

In which completion-nvim set the completion confirm key to which overwrites auto pairs .

The solve was like this

let g:completion_confirm_key = ""
imap <expr> <cr>  pumvisible() ? complete_info()["selected"] != "-1" ?
                 \ "\<Plug>(completion_confirm_completion)"  : "\<c-e>\<CR>" :  "\<CR>"

or in lua config

vim.cmd([[let g:completion_confirm_key = ""]])
vim.cmd([[
imap <expr> <cr>  pumvisible() ? complete_info()["selected"] != "-1" ? "\<Plug>(completion_confirm_completion)"  : "\<c-e>\<CR>" :  "\<CR>"
]])

Thanks for your help 🤗🤗

closing this issue.