Module view
The currently focused view. It also represents the structure of any view table in `_G._VIEWS`.
Fields
size [number]: The position of the split resizer (if this view is part of
a split view).
Functions
| view:goto_buffer (n, relative) |
Goes to the specified buffer in the indexed view. |
| view:split (vertical) |
Splits the indexed view vertically or horizontally and focuses the new view. |
| view:unsplit () |
Unsplits the indexed view if possible. |
Tables
| buffer |
The buffer this view contains. |
Functions
- view:goto_buffer (n, relative)
-
Goes to the specified buffer in the indexed view. Generates `BUFFER_BEFORE_SWITCH` and `BUFFER_AFTER_SWITCH` events.
Parameters
-
n: A relative or absolute buffer index. An absolute index of `-1` goes to the last buffer.
-
relative: Flag indicating if `n` is a relative index or not. Defaults to `false`.
- view:split (vertical)
-
Splits the indexed view vertically or horizontally and focuses the new view.
Parameters
-
vertical: Flag indicating a vertical split. Defaults to `false` for horizontal.
Return value:
old view and new view tables.
- view:unsplit ()
-
Unsplits the indexed view if possible.
Return value:
boolean if the view was unsplit or not.
Tables
- buffer
- The buffer this view contains. (Read-only)