Total Complexity | 3 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Coverage | 55.56% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | """API for working with Nvim tabpages.""" |
||
8 | 6 | class Tabpage(Remote): |
|
9 | """A remote Nvim tabpage.""" |
||
10 | |||
11 | 6 | _api_prefix = "tabpage_" |
|
12 | |||
13 | 6 | def __init__(self, *args): |
|
14 | """Initialize from session and code_data immutable object. |
||
15 | |||
16 | The `code_data` contains serialization information required for |
||
17 | msgpack-rpc calls. It must be immutable for Buffer equality to work. |
||
18 | """ |
||
19 | super(Tabpage, self).__init__(*args) |
||
20 | self.windows = RemoteSequence(self, 'tabpage_get_windows') |
||
21 | |||
22 | 6 | @property |
|
23 | def window(self): |
||
24 | """Get the `Window` currently focused on the tabpage.""" |
||
25 | return self.request('tabpage_get_window') |
||
26 | |||
27 | 6 | @property |
|
28 | def valid(self): |
||
29 | """Return True if the tabpage still exists.""" |
||
30 | return self.request('tabpage_is_valid') |
||
31 |