Skip to content

Commit a65f24e

Browse files
committed
Add wrappers for ui_attach, ui_detach and ui_try_resize
1 parent abb6ad1 commit a65f24e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

neovim/api/nvim.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,25 @@ def session(self):
8686
"""Return the Session or SessionFilter for a Nvim instance."""
8787
return self._session
8888

89+
def ui_attach(self, width, height, rgb):
90+
"""Register as a remote UI.
91+
92+
After this method is called, the client will receive redraw
93+
notifications.
94+
"""
95+
return self._session.request('ui_attach', width, height, rgb)
96+
97+
def ui_detach(self):
98+
"""Unregister as a remote UI."""
99+
return self._session.request('ui_detach')
100+
101+
def ui_try_resize(self, width, height):
102+
"""Notify nvim that the client window has resized.
103+
104+
If possible, nvim will send a redraw request to resize.
105+
"""
106+
return self._session.request('ui_try_resize', width, height)
107+
89108
def subscribe(self, event):
90109
"""Subscribe to a Nvim event."""
91110
return self._session.request('vim_subscribe', event)

0 commit comments

Comments
 (0)