auto-pairs icon indicating copy to clipboard operation
auto-pairs copied to clipboard

On start issue

Open 7ijme opened this issue 1 year ago • 4 comments

Hey there,

I'm having an issue where if I press ; or / when I start neovim. I get this error. I have isolated the problem to this plugin, because when I delete it it doesn't error. When I do something first, like opening a file, it won' give me this error.

Error detected while processing function <lambda>261[1]..<SNR>96__open_win: line   22:
5555: API call: Vim(let):E716: Key not present in Dictionary: "rhs"

https://user-images.githubusercontent.com/68817281/226198754-b0bba11c-eded-4eb4-b540-b642d422e21a.mp4

7ijme avatar Mar 19 '23 18:03 7ijme

Looks like <CR> is remapped, and maparg spews out something unexpected. There's probably an incompatible plugin. What's the output of imap <CR>?

LunarWatcher avatar Mar 19 '23 18:03 LunarWatcher

It's linked to cmp.utils.keymap.set_map from hrsh7th/nvim-cmp, which is required by VonHeikemen/lsp-zero.nvim. However, I have switched to cohama/lexima.vim which does the same thing as this and is compatible.

7ijme avatar Mar 19 '23 19:03 7ijme

If a different plugin has the same problem, then it's not auto-pairs' or lexima's fault. It's either the other plugin, or your version of nvim interacting weirdly with maparg

LunarWatcher avatar Mar 21 '23 18:03 LunarWatcher

Relevant neovim bug: https://github.com/neovim/neovim/issues/23666 Extended debugging over in my fork: https://github.com/LunarWatcher/auto-pairs/issues/78

TL;DR: Lua mappings don't populate rhs (which is guaranteed populated by the docs), breaking compatibility with auto-pairs

LunarWatcher avatar May 17 '23 15:05 LunarWatcher