Module vpe.windows¶
Window specific support.
This provides support for working with Vim window layouts. The intended way to
use this is to use LayoutElement.create_from_vim_layout
. For example:
layout = LayoutElement.create_from_vim_layout(vim.winlayout())
The returned value will be a LayoutRow
, LayoutColumn
or LayoutWindow
window instance. Use the type_name
class attribute when it is necessary to
know the actual type.
LayoutColumn¶
LayoutElement¶
- class vpe.windows.LayoutElement(elements: List)¶
An element in a window layout.
Each element is either a LayoutRow, LayoutColumn or a LayoutWindow.
Attributes
- type_name¶
A class attribute used to identify the type of element.
Methods
- apply_sizes()¶
Apply this layout’s sizes to the actual Vim window layout.
- describe(level=0)¶
Generate a description as a sequence of lines.
The description is intended to be user friendly. It is best not to rely on its format because it may change in future releases.
- iter_windows()¶
Iterate throught the leaf windows.
- set_widths_from_layout(layout: LayoutElement)¶
Update the widths using another layour element.
Parameters
- layout: LayoutElement
The
LayoutElement
to copy from.
Class methods
- classmethod create_from_vim_layout(layout)¶
Create LayoutElement from the result of a winlayout() call.