Closed mikehaertl closed 7 months ago
Some snippets cause the menu to immediately close, when selected with prev/next in the menu. They also insert a messed up version of the snippet.
Here is an example snippet:
{ "msg": { "prefix": ["msg"], "body": [ "[$1] $2" ] } }
If I type ms the menu opens:
ms
If I now just select the first item (i.e. <c-j> without confirming!), the menu closes immediately and inserts the first part of the template:
<c-j>
This happens since commit 18ff44c (Improve Symbol handling).
It does not happen for all snippets. I could not find out what exactly makes some snippets cause this problems, while others still work fine.
My nvim-cmp config:
cmp.setup({ snippet = { expand = function(args) vim.fn['vsnip#anonymous'](args.body) end, }, mapping = { ['<C-j>'] = cmp.mapping(cmp.mapping.select_next_item(), {'i', 'c'}), ['<C-k>'] = cmp.mapping(cmp.mapping.select_prev_item(), {'i', 'c'}), ['<CR>'] = function(fallback) if cmp.visible() and cmp.get_selected_entry() and not (cmp.get_selected_entry().source.name == 'nvim_lsp_signature_help') then cmp.confirm({ select = false, }) else fallback() end end }, sources = cmp.config.sources({ { name = 'vsnip' }, }), })
The issue goes away if I disable the https://github.com/andymass/vim-matchup plugin. So it must probably get fixed there.
Some snippets cause the menu to immediately close, when selected with prev/next in the menu. They also insert a messed up version of the snippet.
Here is an example snippet:
If I type
ms
the menu opens:If I now just select the first item (i.e.
<c-j>
without confirming!), the menu closes immediately and inserts the first part of the template:This happens since commit 18ff44c (Improve Symbol handling).
It does not happen for all snippets. I could not find out what exactly makes some snippets cause this problems, while others still work fine.
My nvim-cmp config: