coc-snippets icon indicating copy to clipboard operation
coc-snippets copied to clipboard

Compatibility issue with andymass/vim-matchup

Open moetayuko opened this issue 1 year ago • 4 comments

https://github.com/andymass/vim-matchup is a popular vim plugin. However, the cursor doesn't behave as expected after expanding some snippets.

MWE

call plug#begin()
 Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'}
 Plug 'honza/vim-snippets'
 Plug 'andymass/vim-matchup'
call plug#end()
set nocp
let g:tex_flavor = "latex"
let g:coc_global_extensions = [
      \ 'coc-snippets',
      \ ]
imap <C-l> <Plug>(coc-snippets-expand)

To reproduce

  1. vim t.tex
  2. type beg<ctrl_l>

The snippet expands correctly, but the cursor doesn't locate at the expected position.

Expected (w/o vim-matchup)

| denotes cursor position

\begin{|}
	
\end{}

Current (w/ vim-matchup)

\be|gin{}
	
\end{}

It's worth noting that https://github.com/SirVer/ultisnips works correctly with vim-matchup

moetayuko avatar Apr 17 '23 08:04 moetayuko