Skip to content

Commit 55ed6b7

Browse files
blueyedbfredl
authored andcommitted
Use nvim_ui_attach/nvim_ui_detach (#345)
* Use nvim_ui_attach/nvim_ui_detach `ui_attach` and `ui_detach` are deprecated. This handles the old signature, and issues a DeprecationWarning itself then. * fixup! Use nvim_ui_attach/nvim_ui_detach
1 parent 3777747 commit 55ed6b7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

neovim/api/nvim.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,17 +240,20 @@ def with_decode(self, decode=True):
240240
return Nvim(self._session, self.channel_id,
241241
self.metadata, self.types, decode, self._err_cb)
242242

243-
def ui_attach(self, width, height, rgb):
243+
def ui_attach(self, width, height, rgb=None, **kwargs):
244244
"""Register as a remote UI.
245245
246246
After this method is called, the client will receive redraw
247247
notifications.
248248
"""
249-
return self.request('ui_attach', width, height, rgb)
249+
options = kwargs
250+
if rgb is not None:
251+
options['rgb'] = rgb
252+
return self.request('nvim_ui_attach', width, height, options)
250253

251254
def ui_detach(self):
252255
"""Unregister as a remote UI."""
253-
return self.request('ui_detach')
256+
return self.request('nvim_ui_detach')
254257

255258
def ui_try_resize(self, width, height):
256259
"""Notify nvim that the client window has resized.

0 commit comments

Comments
 (0)