nvim-lua / completion-nvim

A async completion framework aims to provide completion to neovim's built in LSP written in Lua
Apache License 2.0
973 stars 78 forks source link

Unwanted auto-completed letters in special buffer #261

Open romgrk opened 4 years ago

romgrk commented 4 years ago

I'm opening the issue regarding an issue that was observed in clap's input window. In some cases, something seems to be typing letters that are not wanted by the user.

Detailed report can be found here: https://github.com/liuchengxu/vim-clap/issues/580

It was observed that both users reporting the issue were using completion.nvim, and I was wondering if you'd have any insight as to why this could be happening.

Thanks.

BokilaLin commented 3 years ago

I add following line to init.vim to avoid conflict with vim-clap.

What the line does is to check buffer type If it is nofile which is for vim-clap buffer, then do nothing; else enable completion for that buffer.

autocmd BufEnter * if &buftype != "nofile" | lua require'completion'.on_attach()

Hope this works for others

tmke8 commented 3 years ago

Thanks @BokilaLin , this worked great. The described problem happened for me with telescope.nvim after I added the buffers completion source which I wanted to be available in all (file) buffers.

cljoly commented 3 years ago

The problem also happens for me with telescope and your solution to check the buftype works. To trigger the bug, I need to have the option completion_auto_change_source set to 1 and the problem goes away if I comment this line (source.triggerCompletion(false, manager)).