Skip to content

Commit de3bbbd

Browse files
committed
nvim.session.threadsafe_call is quite common. Support it a bit longer.
1 parent 44c6f47 commit de3bbbd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

neovim/api/nvim.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def __init__(self, session, channel_id, metadata, types,
8383
self.windows = RemoteSequence(self, 'vim_get_windows')
8484
self.tabpages = RemoteSequence(self, 'vim_get_tabpages')
8585
self.current = Current(self)
86+
self.session = CompatibilitySession(self)
8687
self.funcs = Funcs(self)
8788
self.error = NvimError
8889
self._decode = decode
@@ -330,6 +331,14 @@ def handler():
330331
self._session.threadsafe_call(handler)
331332

332333

334+
class CompatibilitySession(object):
335+
336+
"""Helper class for API compatibility."""
337+
338+
def __init__(self, nvim):
339+
self.threadsafe_call = nvim.async_call
340+
341+
333342
class Current(object):
334343

335344
"""Helper class for emulating vim.current from python-vim."""

0 commit comments

Comments
 (0)