From 318c1b56543903e92654bd131f615e709bf70932 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Thu, 26 Aug 2021 11:37:26 +0300 Subject: [PATCH] fix the first call to sync functions returning null (#496) This happens only right after instantiation of the plugin class, so calling any other asynchronous function seemingly fixes the problem. Fixes #434 --- pynvim/plugin/host.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pynvim/plugin/host.py b/pynvim/plugin/host.py index ee68b063..9f3c7282 100644 --- a/pynvim/plugin/host.py +++ b/pynvim/plugin/host.py @@ -89,9 +89,9 @@ def _wrap_delayed_function(self, cls, delayed_handlers, name, sync, self._discover_functions(plugin, module_handlers, path, False) if sync: - self._request_handlers[name](*args) + return self._request_handlers[name](*args) else: - self._notification_handlers[name](*args) + return self._notification_handlers[name](*args) def _wrap_function(self, fn, sync, decode, nvim_bind, name, *args): if decode: