Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Mte90 opened this issue Jun 11, 2024 · 5 comments
Open

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

Mte90 opened this issue Jun 11, 2024 · 5 comments

Comments

@Mte90
Copy link
Contributor

Mte90 commented Jun 11, 2024

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

call rpcnotify(0, 'Gui', 'CursorMoved', l:minLineVisible, l:bufferSize, l:windowHeight)
kind of call looking to similar errors aurieh/discord.nvim#22 neovim/neovim#8053

@kierun
Copy link

kierun commented Jun 11, 2024

@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
Copy link
Contributor Author

Mte90 commented Jun 11, 2024

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
Copy link
Contributor Author

Mte90 commented Jun 11, 2024

I think that depends on this change neovim/neovim#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
Copy link
Contributor Author

Mte90 commented Jun 11, 2024

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
Copy link
Owner

equalsraf commented Jul 24, 2024

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

  • the gui shim plugin does use rpcnotify(0 for events (Dir, Gui). and is triggering these messages
  • the messages themselves are not sent by nvim-qt or the shim, but rather pynvim?

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

  • start nvim-qt (also works with the gui shim plugin and terminal nvim)
  • make sure some python plugin is working e.g. with deoplete call deoplete#enable()

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:

  • GuiForeground
  • GuiWindowMaximized/Fullscreen/Frameless
  • GuiFont
  • GuiLinespace
  • GuiMouseHide
  • GuiTabline*
  • GuiPopupmenu
  • Treeshow/hide

Autocommands

  • CursorMoved
  • DirChanged
  • VimLeave
  • VimEnter
  • WinEnter

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants