adolenc / cl-neovim

Common lisp client for neovim
MIT License
98 stars 4 forks source link

Autocommands hang in nvim-0.2.2 #13

Closed jurov closed 6 years ago

jurov commented 6 years ago

Steps to reproduce: In Lisp REPL:

(ql:quickload :cl-neovim)
(nvim:connect)
(nvim:defautocmd/s buf-enter (stuff) nil)

Now any buffer switching will completely hang neovim. It waits forever for synchronous rpc call to return.

Perhaps there's no event loop on lisp side and it is necessary to start it, how?

jurov commented 6 years ago

Confirmed - calling (nvim::listen-once) does the processing and unsticks nvim. Perhaps it should be documented that event loop is not ran by default.

adolenc commented 6 years ago

Yeah, defining synchronous stuff from the REPL is really not nice, but I'm not really sure how to improve the behavior without resorting to threads (which I never really wanted to do since like a billion things could potentially break).

You are completely correct with your hypothesis. I tried documenting (listen-once) in the readme but I completely understand how the behavior could still be confusing after reading that paragraph. I'll try improving that a bit.

jurov commented 6 years ago

Overall, it's hard to integrate cl-neovim into application that does other asynchronous stuff, since the event loop is managed by C library, and that causes problems with threads too (I tried). But removing libuv dependency is completely out of scope of this project, I guess this can be closed.