Closed astier closed 2 years ago
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
pastes {pumvisible() ? '' : over and over again.
vim-hyperstyle has the same issue.
same issue, temporarily switching to coc-pairs
, although I'd love to have closer
work
Can confirm that I also have this issue, using COQ.nvim
+1 here
Thanks for the replies everyone. I have no idea how to fix this and could use some help.
On Wed, 12 Jan 2022, 4:28 am Geoff Franks, @.***> wrote:
+1 here
— Reply to this email directly, view it on GitHub https://github.com/rstacruz/vim-closer/issues/37#issuecomment-1010193983, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAASFEME64ADJUC5S7NT2K3UVRSCVANCNFSM454PJMVA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
I'm not sure that's best fixed on your end rather than on the completers' (non-expr mapping) or Neovim's end (ability to "chain" mappings?), but perhaps at least put a warning in the README? This bug affects multiple auto-completers, isn't trivial to isolate, and is quite disruptive (complete neovim hang), so I figure people would be glad to know before getting bitten.
It took me days to find out this was the root cause for my hangs, I'd sure have appreciated a heads up. 😅
I added a note to the README now. Thanks all, would appreciate some ideas on how to fix this.
Someone has posted a workaround in #22.
I recently solved this for Endwise and Eunuch. My recommended approach would be to give closer#close()
an optional ...
argument and add something like this to the top: https://github.com/tpope/vim-eunuch/blob/74e0e1662cc9ed3d58ba3e3de20eb30ac4039956/plugin/eunuch.vim#L438-L440
Then when defining the <CR>
map, you can chain to an existing <expr>
map by passing the original definition as an argument: https://github.com/tpope/vim-eunuch/blob/74e0e1662cc9ed3d58ba3e3de20eb30ac4039956/plugin/eunuch.vim#L468-L485
P.S. Endwise and Eunuch now default to this approach, which means vim-closer now suffers from this issue if either is installed.
A fix was just merged, give it a go!
Seems to work. Thanks for fixing!
System
Reproducible with all the following vim-version:
Problem
vim-closer hangs when trying to close a bracket if an insert-mapping exists which executes
<expr>
dependent onpumvisible()
.VIMRC
Reproduce
vim bug.sh
{
and press<cr>
:i{<cr>
<c-c>
It should be visible that vim-closer created a long line which looks like this:
It essentially pastes
{pumvisible() ? '' :
over and over.Related
22
25