Civitasv / cmake-tools.nvim

CMake integration in Neovim
GNU General Public License v3.0
367 stars 60 forks source link

Unexpected input keys in Neovim due to autocommand #202

Open athanase opened 6 months ago

athanase commented 6 months ago

Bug description I think I discovered a bug in this plugin while configuring fzf-lua with a another plugin window-picker.

one character is deleted and some characters are written to the newly opened buffer: -\><C-n><CR>

I have tracked down the line responsible for this behavior: https://github.com/Civitasv/cmake-tools.nvim/blob/a4cd0b3a2c8a166a54b36bc00579954426748959/lua/cmake-tools/init.lua#L1603

I don't understand why this is triggered, or why this behavior would happened ? This does not happen when this plugin is disabled.

Steps to reproduce

1) I launch the fzf-lua window to select a file to open 2) I trigger the window-picker upon selecting a file to select the window in which I want the file to be opened 3) the window-picker exits abnormally 4) the selected file opens in the wrong window 5) neovim switches to insert mode 6) one character is deleted and some characters are written to the newly opened buffer: -\><C-n><CR>

Expected behavior No characters are deleted nor written to a buffer by the plugin.

Screenshots

Environment

Contents in the *cmake-tools* buffer

khris190 commented 5 months ago

@Civitasv hey, could you elaborate on this nvim_feedkeys line, i tried to deal with this issue but i don't even have those keymaps. the comment only talks about exiting insert mode

Civitasv commented 5 months ago

I've confirmed that this code block have already deprecated. Check the new commit, it should work now.