nvim-cmp icon indicating copy to clipboard operation
nvim-cmp copied to clipboard

Inserting "<Plug>(cmp.u.k.recursive: )" when using tab in insert mode

Open ChristianChiarulli opened this issue 2 years ago • 5 comments

FAQ

  • [X] I have checked the FAQ and it didn't resolve my problem.

Issues

  • [X] I have checked existing issues and there are no open or closed issues with the same problem.

Neovim Version

0.6.1

Minimal reproducible config

This is the code I'm using for tab completions, I'll try to get a minimal example here soon.

https://github.com/ChristianChiarulli/nvim/blob/a5f5fb81b652fde891a6abd228cf3e9e878ea218/lua/user/cmp.lua#L132

Description

Since this commit: https://github.com/hrsh7th/nvim-cmp/commit/f4bb6ffdb1d5377be93283ff087a5ff97e23524f

I am unable to use the key in insert mode, <Plug>(cmp.u.k.recursive: ) is inserted instead

Steps to reproduce

open any filetype and press tab in insert mode

Expected behavior

tab behaves normally in insert mode

Actual behavior

<Plug>(cmp.u.k.recursive: ) is inserted instead

Additional context

No response

ChristianChiarulli avatar Feb 02 '22 20:02 ChristianChiarulli

seems to be a copilot thing: https://github.com/hrsh7th/nvim-cmp/issues/459, closing

ChristianChiarulli avatar Feb 02 '22 20:02 ChristianChiarulli

Hi I got this with latest master, not using copilot. Only other difference is I get this when I press enter. "<Plug>(cmp.u.k.recursive:)".

To fix I used the following which seemed to do the trick:

:LvimCacheReset and :LvimUpdate.

Weird!

jimcornmell avatar Apr 07 '22 13:04 jimcornmell

Thanks @jimcornmell -- I also don't use copilot and had this problem. But I also don't use LunaVim so don't have that LvimCacheReset command. But this did remind me that it could be an issue with the Impatient plugin. For me, calling :LuaCacheClear after a fresh update solved the issue. Hope this helps the next person.

zmre avatar Apr 10 '22 00:04 zmre

Started doing this again for me today, I've removed all plugins and then added one at a time until the error reappeared. It started to go wrong again with the following added to my config:

{
 "tpope/vim-eunuch",
 event = "BufRead",
},

jimcornmell avatar Apr 11 '22 14:04 jimcornmell

Still happening for me with the latest nvim-cmp.

The culprit for me seems to be:

imap <expr> <Tab>   vsnip#jumpable(1)   ? '<Plug>(vsnip-jump-next)'      : '<Tab>'
smap <expr> <Tab>   vsnip#jumpable(1)   ? '<Plug>(vsnip-jump-next)'      : '<Tab>'
imap <expr> <S-Tab> vsnip#jumpable(-1)  ? '<Plug>(vsnip-jump-prev)'      : '<S-Tab>'
smap <expr> <S-Tab> vsnip#jumpable(-1)  ? '<Plug>(vsnip-jump-prev)'      : '<S-Tab>'

Leandros avatar May 30 '22 07:05 Leandros

This happens whenever I press <S-Tab> in INSERT mode. The infinite recursion can be stopped by pressing <C-c>. The following output is left in the buffer:

<SNR>0_(cmp.u.k.recursive:<SNR>0_(cmp.u.k.recursive:[REPEAT MANY TIMES]<SNR>

~~I do have copilot.lua and copilot-cmp installed.~~ Happens regardless of whether or not copilot is installed.

YodaEmbedding avatar Feb 14 '23 04:02 YodaEmbedding

Sorry. I lost this issue.

https://github.com/hrsh7th/nvim-cmp/issues/770#issuecomment-1095103398

The above comment is informative. I'll try to check this.

Other comments, I can't guess anything. Sorry.

hrsh7th avatar Feb 14 '23 10:02 hrsh7th

I tried with tpope/vim-eunuch but it doesn't display recursive broken mapping.

hrsh7th avatar May 07 '23 05:05 hrsh7th