neovim / pynvim

Python client and plugin host for Nvim
http://pynvim.readthedocs.io/en/latest/
Apache License 2.0
1.48k stars 118 forks source link

Fix the first call to sync functions returning null #496

Closed dmitmel closed 2 years ago

dmitmel commented 2 years ago

This happens only right after instantiation of the plugin class, so calling any other asynchronous function seemingly fixes the problem.

Fixes #434.

justinmk commented 2 years ago

Nice, thank you! Does it look possible to add a test?

dmitmel commented 2 years ago

Dunno, I don't see any tests involving plugin classes or similar. Plus this bug is just a one-off typo to me.

HiPhish commented 2 years ago

Sorry for bumping this PR, but what are the chances of getting a bugfix release soon? I need this for a plugin I am writing currently. It's not urgent, but I would rather avoid following HEAD for just one plugin.

dmitmel commented 2 years ago

As a workaround you can just post some dummy notification/request to the remote plugin when Vim loads. An empty method on the Python side is enough.

HiPhish commented 2 years ago

I know, I already am doing that, so it's not a big deal, just ugly. (I am making a plugin which reads in the linter settings from pycodestyle and returns a dictionary, so I can set my Python file type settings automatically to match the linter settings)

wookayin commented 10 months ago

A kind bump-up: pynvim v0.5.x (or any new version that includes this fix) is still unreleased.

justinmk commented 9 months ago

I think @bfredl is required for that currently :)

bfredl commented 9 months ago

What PyPI username should I add to the package?

justinmk commented 9 months ago

"nvim" ? what was it before?