auto-pairs <CR> overrides selection's action
https://github.com/jiangmiao/auto-pairs/issues/380
Very random behavior observed...
(I) output of :verbose imap <cr> (I am in main.c)
i <CR> * <Plug>EasycompleteCR
Last set from ~/.config/nvim/plugged/vim-easycomplete/autoload/easycomplete.vim line 207
(II) output of :verbose imap <cr> (I am in header include/shader.h)
i <CR> &@easycomplete#TypeEnterWithPUM()<SNR>22_AutoPairsReturn
Last set from ~/.config/nvim/plugin/auto-pairs.vim line 664
i <CR> * <Plug>EasycompleteCR
Last set from ~/.config/nvim/plugged/vim-easycomplete/autoload/easycomplete.vim line 207
I think @easycomplete#TypeEnterWithPUM() above should not be there.
NOW, when i start fresh session of nvim without opening any file except for main.c
(III) output of :verbose imap <cr>
i <CR> &@<CR><SNR>22_AutoPairsReturn
Last set from ~/.config/nvim/plugin/auto-pairs.vim line 664
i <CR> * <Plug>EasycompleteCR
Last set from ~/.config/nvim/plugged/vim-easycomplete/autoload/easycomplete.vim line 207
Now this works perfect, but if I go to definition of function (it directly to declaration unless you have the respective C file indexed... clangd issue... this was not the case before... it used to retrieve definitions just fine using compile_flags.txt now everythings broken... whoops... coming back to topic) for example use_shader() in shader.h, we reset back to case (II)
as of now, the working commit is: 1db4a17ee62c1947b898131c4facd199cf07a185
output of :verbose imap <cr> :
i <CR> &@<SNR>22_AutoPairsOldCRWrapper73<SNR>22_AutoPairsReturn
Last set from ~/.config/nvim/plugin/auto-pairs.vim line 664
i <CR> * easycomplete#TypeEnterWithPUM()
Last set from ~/.config/nvim/plugged/vim-easycomplete/plugin/easycomplete.vim line 595
I don't know the reason for the constant conflict. I just unmap the <cr> mapping to disable <cr> of auto-pair when vim-easycomplete is running.
Okay, then maybe the problem is when vim-easycomplete is running, so does that correspond to how vim-easycomplete interacts with vim's builtin completion? or when we use a keybind to trigger easycomplete e.g. <Tab> ? because this time while testing on 670da88c63458824e2aa5d392d3a55bfa0ecc001 there was no mapping to auto-pairs.
(it somehow even broke Telescope fzf)
I shall get back with more info on this (that is, the exact commit where the
With the last update, are there any error messages?
No conflict with config or error messages upon launching nvim as such.
Any particular string you want me to look for in nvim logs ??
There should be no. Thank you for your feedback.
(it somehow even broke Telescope fzf)
I shall get back with more info on this (that is, the exact commit where the mapping problem begins)
Hi, turns out it unmaps everything binded to <CR> when using other plugins,
switches back to i <CR> * <Plug>EasycompleteCR when not.
function! easycomplete#TypeEnterWithPUM()
if !(g:easycomplete_pum_noselect)
let l:item = easycomplete#GetCursordItem()
else
let l:item = easycomplete#GetCompletedItem()
endif
in above code can't we map <CR> back to AutoPairs and return in the else statement? that is, when no item is selected use simple <CR> and not use EasycompleteCR.