equalsraf / neovim-qt

Neovim client library and GUI, in Qt5.
https://github.com/equalsraf/neovim-qt/wiki
ISC License
1.86k stars 171 forks source link

no notification handler registered for "Dir" / "GUI" with nvim 0.11 #1112

Open Mte90 opened 5 months ago

Mte90 commented 5 months ago

So me and another user using nvim nightly is getting tons of errors:

So my guess is that something is new in neovim and this client don't updated to that change.

I think that is something depending on https://github.com/equalsraf/neovim-qt/blob/442abfba5399303cda8d8c6e9eaf7ed4227f4820/src/gui/runtime/plugin/nvim_gui_shim.vim#L239 kind of call looking to similar errors https://github.com/aurieh/discord.nvim/pull/22 https://github.com/neovim/neovim/issues/8053

kierun commented 5 months ago

@Mte90 The problem stems from equalsraf/neovim-gui-shim. Once I removed it, the issue vanished for me. However, I cannot for the life of me remember why I needed it in the first place!

Mte90 commented 5 months ago

I don't have that plugin but looking at the code is the same on the file that I mentioned (also the file name is the same).

The error is generated by the nvim python library and involve the rpcnotify for sure https://github.com/neovim/pynvim/blob/master/pynvim/plugin/host.py#L144

Mte90 commented 5 months ago

I think that depends on this change https://github.com/neovim/neovim/pull/28487 that changed the way rpcnotify manage channels.

Looking at https://github.com/search?q=repo%3Arliang%2Fnvim-pygtk3+gui_channel&type=code and the documentation now 0 channel is like a global one instead everyone should do their channel

Mte90 commented 5 months ago

So in my machine I had /usr/local/share/nvim-qt/ folder that had the shim not updated since 4 years...

So like in your case it was loaded automatically but I never noticed.

The make install process doesn't clean up that case...

equalsraf commented 4 months ago

if I am understanding this correctly the way rpcnotify(0 works changed to send messages to all channels.

To reproduce I had to run the gui along a working python plugin:

At this point cursor movements and various other events will show the message from here:

https://github.com/neovim/pynvim/blob/f9e56f8ef2a0d93da4ad1c64e82066be77ecde64/neovim/plugin/host.py#L110

I suppose the best we can do is replace calls to rpcnotify(0 in the shim with something else. Possibly using chan from nvim_list_uis().

In fact we already do this in some places. However we DO NOT do it for the following

Commands:

Autocommands

Note: Consulting nvim_list_uis() with every cursor move does not sound like a good idea. See UIEnter/UILeave

Note: nvim_list_uis is from API4 (nvim 0.3 i think)