1 """API for working with Nvim tabpages."""
2 from pynvim.api.common import Remote, RemoteSequence
9 """A remote Nvim tabpage."""
11 _api_prefix = "nvim_tabpage_"
13 def __init__(self, *args):
14 """Initialize from session and code_data immutable object.
16 The `code_data` contains serialization information required for
17 msgpack-rpc calls. It must be immutable for Buffer equality to work.
19 super(Tabpage, self).__init__(*args)
20 self.windows = RemoteSequence(self, 'nvim_tabpage_list_wins')
24 """Get the `Window` currently focused on the tabpage."""
25 return self.request('nvim_tabpage_get_win')
29 """Return True if the tabpage still exists."""
30 return self.request('nvim_tabpage_is_valid')
34 """Get the tabpage number."""
35 return self.request('nvim_tabpage_get_number')