Please complete these steps and check these boxes (by putting an x inside
the brackets) _before_ filing your issue:
vim --version.:YcmDebugInfo.:YcmToggleLogs command.install.py (or cmake/make/ninja) including its invocationThank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.
By the 'delimitMateBackspace' functionality when we delete an opening delimiter with "\ Running the :DelimitMateTest with and without YCM plugin activated we see the remapping of "\ without YCM: with YCM: Include steps to reproduce here. Have https://github.com/Raimondi/delimitMate plugin and YouCompleteMe plugin active, for example open a PHP file. write: function test ( | ) then press "\ function test | write: function test ( | ) then press "\ function test (| I think its this line of code added on last commit https://github.com/Valloric/YouCompleteMe/blob/master/autoload/youcompleteme.vim#L252 Maybe have an option to add or remove keys to this functionality? Thanks in advance, sorry for bad English.
i "\
Last set from ~/.vim/bundle/delimitMate/plugin/delimitMate.vim
i "\
Last set from ~/.vim/bundle/YouCompleteMe/autoload/youcompleteme.vim
@micbou I think we should do something like https://github.com/tpope/vim-endwise/blob/master/plugin/endwise.vim#L113-L116 where if the key is already mapped we just concatenate the actions and do both of them; and maybe we should also check if pumvisible?
@vheon Thanks for the link. I implemented a similar approach in this branch. It seems to work fine with the DelimitMate plugin. @davidsierradz Could you try it out?
@davidsierradz As a workaround you could try using auto-pairs. I'm using it and didn't stumble upon this problem.
@micbou, downloaded and tested the branch, I think its working good, thanks.
@micbou Any advances in merging this fix to upstream?
Anybody who wanted to use this feature can just
clone the repo locally, .vimrcSorry for the lack of answer. I am not really satisfied with the solution because it adds the OnDeleteChar function to the <BS> key even if the user remapped it to something that have nothing to do with deleting characters in insert mode. I think a better approach would be to expose the OnDeleteChar function through a mapping and let users remap the <BS> key as follows:
imap <BS> <Plug>YcmOnDeleteChar<Plug>delimiteMateBS
where <Plug>YcmOnDeleteChar is the mapping exposing OnDeleteChar. This would be mentioned in the FAQ. Thoughts?
In the meantime, a workaround is to add the following to your vimrc:
imap <silent> <BS> <C-R>=YcmOnDeleteChar()<CR><Plug>delimitMateBS
function! YcmOnDeleteChar()
if pumvisible()
return "\<C-y>"
endif
return ""
endfunction
@davidsierradz we've changed the YCM completion implementation in #3645 could you try that PR and see if it resolves this issue ? I don't use any of these plugins delimit plugins.
@puremourning I arrived here because of this issue. I updated YouCompleteMe and looks like delimitMate backspace works as intended without work arounds.
Great thanks.
Most helpful comment
@micbou Any advances in merging this fix to upstream?