# view

A Textadept view object.

- - -

## Fields

- - -

<a id="size"></a>
### `size` (number)

The position of the split resizer (if this view is part of a split view).

- - -


## Functions

- - -

<a id="goto_buffer"></a>
### `goto_buffer`(*view, n, relative*)

Goes to buffer number *n* in the view.
If *relative* is `true`, *n* is an index relative to the index of the current
buffer in `_G._BUFFERS` instead of an absolute index.
Emits `BUFFER_BEFORE_SWITCH` and `BUFFER_AFTER_SWITCH` events.

Parameters:

* *`view`*: The view to switch buffers in.
* *`n`*: A relative or absolute buffer index in `_G._BUFFERS`. An absolute
  index of `-1` goes to the last buffer.
* *`relative`*: Optional flag indicating whether *n* is a relative or
  absolute index. The default value is `false`, for an absolute index.

See also:

* [`_G._BUFFERS`](_G.html#_BUFFERS)
* [`events.BUFFER_BEFORE_SWITCH`](events.html#BUFFER_BEFORE_SWITCH)
* [`events.BUFFER_AFTER_SWITCH`](events.html#BUFFER_AFTER_SWITCH)

- - -

<a id="split"></a>
### `split`(*view, vertical*)

Splits the view into top and bottom views, unless *vertical* is `true`,
focuses the new view, and returns both the old and new views.
If *vertical* is `false`, splits the view vertically into left and
right views.
Emits a `VIEW_NEW` event.

Parameters:

* *`view`*: The view to split.
* *`vertical`*: Optional flag indicating whether or not to split the view
  vertically. The default value is `false`, for horizontal.

Return:

* old view and new view.

See also:

* [`events.VIEW_NEW`](events.html#VIEW_NEW)

- - -

<a id="unsplit"></a>
### `unsplit`(*view*)

Unsplits the view if possible, returning `true` on success.

Parameters:

* *`view`*: The view to unsplit.

Return:

* boolean if the view was unsplit or not.

- - -


## Tables

- - -

<a id="buffer"></a>
### `buffer`

The [buffer](buffer.html) the view contains. (Read-only)

- - -

