jeanguyomarch / eovim

The Enlightened Neovim
https://github.com/jeanguyomarch/eovim/wiki
MIT License
193 stars 3 forks source link

neovim >=0.3.2 not working #38

Closed devendor closed 5 years ago

devendor commented 5 years ago

The gui can't seem to open a file and display any contents when nvim version is >= 0.3.2. Using 0.3.1 works. The config section works, but no buffer. If you make error in init.vim, you get a brief startup error before it goes blank. It works fine on 0.3.1.

The effected nvim versions trigger this log message on stdout or stderrr of invoking terminal.

ERR<26674>:eovim /home/me/share/util/src/eovim/src/nvim.c:360 _nvim_received_data_cb() Invalid message identifier 0

Several other front ends seem to break starting with 0.3.2 also.

https://github.com/onivim/oni/issues/2704

devendor commented 5 years ago

I found the comment line in nvim.c to print the msgpack data and produced this above the logged error.

--------
[0, 1, "vimenter", []]
--------
ERR<26988>:eovim /home/me/share/util/src/eovim/src/nvim.c:360 _nvim_received_data_cb() Invalid message identifier 0
devendor commented 5 years ago

It looks like a change was made so that empty vimenter messages are sent during and after the vimenter phase of startup in 0.3.2.

in-neovim-src --> git diff  v0.3.1 v0.3.2 --  |grep -Ei '^\+\+|vimenter' |grep -1i vimenter
+++ b/runtime/doc/autocmd.txt
 |VimEnter|             after doing all the startup stuff
+++ b/runtime/doc/change.txt
--
+++ b/runtime/doc/starting.txt
-               empty after |VimEnter|.
+               empty in or after |VimEnter|.
+++ b/runtime/doc/syntax.txt
--
+++ b/runtime/doc/ui.txt
+   register an autocmd for VimEnter at this point: >
+    nvim_command("autocmd VimEnter * call rpcrequest(1, 'vimenter')")
+5.  If step 3 was used, nvim will send a blocking "vimenter" request to the
+++ b/runtime/doc/undo.txt
--
+++ b/src/nvim/testdir/test_autocmd.vim
   au! VimEnter
+++ b/src/nvim/testdir/test_autoload.vim
--
+++ b/test/functional/shada/marks_spec.lua
              '-c', 'autocmd VimEnter * qall')
+++ b/test/functional/shada/shada_spec.lua
devendor commented 5 years ago

I confirmed that no such vimenter messages are output in the stream when invoked with 0.3.1. It seems like it should just be a matter of sending a command to enter normal mode when the gui is fully started, and ignoring empty vimenter messages.

devendor commented 5 years ago

This is the full trace after compiling with msgpack debug output from working vs non-working versions. You can see the issue they're looking to git rid of on line 14 where the two diverge. 0.3.1 puts a bunch of ui-events before startup is ready while 0.3.2 and above send the empty vimenter message that triggers the issue.

eovim-0.3.1.stderr.txt eovim-0.3.2.stderr.txt

jeanguyomarch commented 5 years ago

Thanks for the report and for taking the time to investigate the issue. I've found and fixed the problems. Indeed the vimenter was blocking, and since requests were not implemented in eovim (only responses and notifications, neovim could not attach to eovim...

I'll sleep on the new changes I made to address the issue; I'll push a fix tomorrow.