hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.
MIT License
7.53k stars 377 forks source link

Nvim-cmp usage of nvim_feedkeys likely triggers insertcharpre autocommand. #1738

Open pawelurbanski opened 8 months ago

pawelurbanski commented 8 months ago

I am developing a plugin that does use the insertcharpre autocommand. It looks like the way Nvim-cmp uses the nvim_feedkeys function causes to trigger the mentioned command. A quick glance at the sources brings up the following observations:

Is there a way to configure the behavior of how the accepted completion values are inserted in the buffer tha t can avoid triggering the insertcharpre autocommand?

In addition ot that Nvim-cmp echoes the number of completions and triggers a message with the content of "Back to the original" after inserting the value. It can be related to how Neovim handles cursor movements and position changes.

I am using Neovim Nightly as of the time of writing (end of October 2023) Neovim 0.10.0 and the latest code from the "Main" branch of Nvim-cmp.

Any hints and help will be as always appreciated.

Best, Pawel