maralla / completor.vim

Async completion framework made ease.
MIT License
1.32k stars 62 forks source link

Fix vim8 hang when ch_status() == 'buffered' but ch_read returns nothing #121

Closed dmotles closed 7 years ago

dmotles commented 7 years ago

It seems that sometimes, the ch_status is buffered, but ch_read is returning nothing. vim_oneshot_handler is stuck in an infinite loop.

Since this is happening in the main thread, vim appears to lockup until you hit Ctrl+c or something to interrupt eval of this code.

Specifically, I've seen this when using the clang autocompletion on C-like languages. If I was typing particularly fast, I would see this issue occur. It was getting annoying.

I ran vim in GDB to try and figure out what was going on, saw that it was evaling this code inside this function. I then added logging to this function and confirmed that the problem was here.

Based on my understanding, it is safe to exit the loop early, you might just not get all your completions...

dmotles commented 7 years ago

This might fix #115

maralla commented 7 years ago

Thanks!