efficient vim config
[dotfiles/.git] / .local / lib / python2.7 / site-packages / pynvim / api / window.py
1 """API for working with Nvim windows."""
2 from pynvim.api.common import Remote
3
4
5 __all__ = ('Window')
6
7
8 class Window(Remote):
9
10     """A remote Nvim window."""
11
12     _api_prefix = "nvim_win_"
13
14     @property
15     def buffer(self):
16         """Get the `Buffer` currently being displayed by the window."""
17         return self.request('nvim_win_get_buf')
18
19     @property
20     def cursor(self):
21         """Get the (row, col) tuple with the current cursor position."""
22         return self.request('nvim_win_get_cursor')
23
24     @cursor.setter
25     def cursor(self, pos):
26         """Set the (row, col) tuple as the new cursor position."""
27         return self.request('nvim_win_set_cursor', pos)
28
29     @property
30     def height(self):
31         """Get the window height in rows."""
32         return self.request('nvim_win_get_height')
33
34     @height.setter
35     def height(self, height):
36         """Set the window height in rows."""
37         return self.request('nvim_win_set_height', height)
38
39     @property
40     def width(self):
41         """Get the window width in rows."""
42         return self.request('nvim_win_get_width')
43
44     @width.setter
45     def width(self, width):
46         """Set the window height in rows."""
47         return self.request('nvim_win_set_width', width)
48
49     @property
50     def row(self):
51         """0-indexed, on-screen window position(row) in display cells."""
52         return self.request('nvim_win_get_position')[0]
53
54     @property
55     def col(self):
56         """0-indexed, on-screen window position(col) in display cells."""
57         return self.request('nvim_win_get_position')[1]
58
59     @property
60     def tabpage(self):
61         """Get the `Tabpage` that contains the window."""
62         return self.request('nvim_win_get_tabpage')
63
64     @property
65     def valid(self):
66         """Return True if the window still exists."""
67         return self.request('nvim_win_is_valid')
68
69     @property
70     def number(self):
71         """Get the window number."""
72         return self.request('nvim_win_get_number')