roxma / nvim-completion-manager

:warning: PLEASE USE https://github.com/ncm2/ncm2 INSTEAD
MIT License
917 stars 49 forks source link

Annoying random \<Plug>(cm_completefunc) insertions #78

Closed sassanh closed 7 years ago

sassanh commented 7 years ago

Sometimes when I'm typing, suddenly a \<Plug>(cm_completefunc) is inserted. Sometimes when i press :w to write the file suddenly a \<Plug>(cm_completefunc) comes after w and as I press <cr> quickly after :w the file actually writes to \<Plug>(cm_completefunc). Does anyone else have this problem?

roxma commented 7 years ago

I have similar issue a few times. It occurs randomly.

Maybe there's a race condition. Or somehow in-compatible with another plugin by feeding keys or modifying the buffer at the same time.

sassanh commented 7 years ago

What do you think about checking if vim is in normal mode before call feedkeys(g:cm_completekeys)?

sassanh commented 7 years ago

Can we avoid feedkeys altogether and use normal function call?

roxma commented 7 years ago

What do you think about checking if vim is in normal mode before call feedkeys(g:cm_completekeys)?

I've just added the check: https://github.com/roxma/nvim-completion-manager/commit/025240dd4053a84610ba370234edb1e35e9a35fe

Can we avoid feedkeys altogether and use normal function call?

It seems it's impossible for omnifunc and completefunc

sassanh commented 7 years ago

OK, I pulled those commits, lets see if it fixes the problem.

roxma commented 7 years ago

Closing.

Reopen if it's still happening.

sassanh commented 7 years ago

It seems to be solved.