jiangmiao / auto-pairs

Vim plugin, insert or delete brackets, parens, quotes in pair
http://www.vim.org/scripts/script.php?script_id=3599
4.09k stars 373 forks source link

Pressing enter to autocomplete inserts actual enter character #346

Closed cubetastic33 closed 2 years ago

cubetastic33 commented 2 years ago

When I press enter to autocomplete from the autocomplete menu, the suggestion gets autocompleted, but an actual enter character also gets inserted along with it. Here's a screenshot of the autocomplete menu: image When I press enter, the text "testing" gets filled, and the cursor moves to the next line. If I uninstall the auto-pairs plugin and try the same thing, the text "testing" gets filled, and the cursor stays on the same line. How do I fix this behavior? Is there a config flag or something I can change?

Also, pressing ctrl + h deletes characters when auto-pairs is installed - if I uninstall it, the keybind works as expected (it's a keybind in the autocomplete extension I use, coq). However, I couldn't find ctrl + h mentioned anywhere as a shortcut in the README of this plugin. Why does this happen? Or should I make a separate issue about this since it's another question?

n0ks commented 2 years ago

Just set let g:AutoPairsMapCR = 0 to disable <CR> mapping.

That's my workaround while im lazy to switch to nvim-autopairs.

cubetastic33 commented 2 years ago

Okay, thank you!