vhakulinen / gnvim

GUI for neovim, without any web bloat
MIT License
1.84k stars 69 forks source link

Gnvim is broken for nvim 0.9+ #206

Closed kGAr6Naaes closed 1 year ago

kGAr6Naaes commented 1 year ago

I wanted to try gnvim out and cloned the repo.

However, when launching gnvim from a command line, all I get is an empty, white window. Launching gnvim from a terminal prints:

(gnvim:18040): Gtk-WARNING **: 23:27:00.020: Finalizing Overflower 0x555eca595d40, but it still has children left:

(gnvim:18040): Gtk-WARNING **: 23:27:00.020: Finalizing Tabline 0x555eca667cf0, but it still has children left:

(gnvim:17677): Gtk-WARNING **: 23:09:51.063: Finalizing Overflower 0x556739a23b10, but it still has children left:

(gnvim:17677): Gtk-WARNING **: 23:09:51.063: Finalizing Tabline 0x556739af95b0, but it still has children left:

Is there a way to fix this?

vhakulinen commented 1 year ago

Which nvim version are you using? Latest I've used gnvim with is 0.8.3. There could be some changes to newer versions of nvim that gnvim fails to handle.

kGAr6Naaes commented 1 year ago

It's version 0.10.0, compiled from the main branch

NVIM v0.10.0-dev-132+ge81331c2b
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
...
TinusgragLin commented 1 year ago

It's version 0.10.0, compiled from the main branch

NVIM v0.10.0-dev-132+ge81331c2b
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
...

Same problem here for neovim 0.9.0 (latest stable), I managed to work around by defaulting the value of --nvim option to nvim-old, which symbol-links to downloaded nvim 0.8.3 appimage.

vhakulinen commented 1 year ago

The issue is with gnvim not respecting this part of the api contract that neovim sets:

Future versions of Nvim may add new update kinds and may append new parameters to existing update kinds. Clients must be prepared to ignore such extensions, for forward-compatibility.

The easy fix is to regenerate the API types and break gnvim for previous versions of neovim, but the more involved fix is to implement custom serde deserializer that knows how to ignore extra fields.

I'm leaning towards only supporting nvim 0.9+ since it contains updated API for making smooth scrolling better (hopefully).

illwieckz commented 1 year ago

Hmm, I got a similar error, but I'm using the stock neovim from Ubuntu 22.10 repository that ships neovim 0.7.2.

Maybe it would be good to have a message saying the version is not compatible, instead of a kind-of-crash.

vhakulinen commented 1 year ago

I was thinking of adding a version check, but didn't get around to it yet.

The updated nvim version requirement is documented on the readme.