# buffer

A Textadept buffer object.
Be careful when storing references to a buffer object because if you attempt
call a buffer function with a non-global buffer, you will get an error. See
[`check_global()`](#check_global) for more information.

[buffer]: _G.html#buffer

- - -

## Fields

- - -

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

The foreground color, in "0xBBGGRR" format, of additional carets.

- - -

<a id="additional_carets_blink"></a>
### `additional_carets_blink` (bool)

Allow additional carets to blink.
  The default value is `true`.

- - -

<a id="additional_carets_visible"></a>
### `additional_carets_visible` (bool)

Display additional carets.
  The default value is `true`.

- - -

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

The alpha value, ranging from `0` (transparent) to `255` (opaque), of
  additional selections.
  The default value is `256`, for no alpha.

- - -

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

The background color, in "0xBBGGRR" format, of additional selections.
  This field has no effect when calling `buffer:set_sel_back(false, ...)`.

- - -

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

The foreground color, in "0xBBGGRR" format, of additional selections.
  This field has no effect when calling `buffer:set_sel_fore(false, ...)`.

- - -

<a id="additional_selection_typing"></a>
### `additional_selection_typing` (bool)

Type into multiple selections.
  The default value is `false`.

- - -

<a id="all_lines_visible"></a>
### `all_lines_visible` (bool, Read-only)

Whether or not all lines in the buffer are visible.

- - -

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

The position of the beginning of the selected text.

- - -

<a id="annotation_lines"></a>
### `annotation_lines` (table, Read-only)

Table of the number of annotation lines for line numbers starting from
  zero.

- - -

<a id="annotation_style"></a>
### `annotation_style` (table)

Table of style numbers for annotations for line numbers starting from zero.
  Only some style attributes are active in annotations: font,
  size/size_fractional, bold/weight, italics, fore, back, and character_set.

- - -

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

The beginning of the range of style numbers used for annotations.
  Annotation styles may be completely separated from standard text styles by
  setting a style offset. For example, setting this to `512` would allow the
  annotation styles to be numbered from `512` upto `767` so they do not
  overlap styles set by lexers (or margins if margins offset is `256`). Each
  style number set with `annotation_style` has the offset added before
  looking up the style.
  The default value is `0`.

- - -

<a id="annotation_text"></a>
### `annotation_text` (table)

Table of annotation text for line numbers starting from zero.

- - -

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

The annotation visibility mode.

  * `_SCINTILLA.constants.ANNOTATION_HIDDEN` (0)
    Annotations are invisible.
  * `_SCINTILLA.constants.ANNOTATION_STANDARD` (1)
    Draw annotations left-justified with no decoration.
  * `_SCINTILLA.constants.ANNOTATION_BOXED` (2)
    Indent annotations to match the text and outline with a box.

  The default value is `0`.

- - -

<a id="auto_c_auto_hide"></a>
### `auto_c_auto_hide` (bool)

Automatically hide the autocompletion list when no entries match typed
  text.
  The default value is `true`.

- - -

<a id="auto_c_cancel_at_start"></a>
### `auto_c_cancel_at_start` (bool)

Cancel autocompletion when backspacing to a position before where
  autocompletion started or before the word being completed.
  The default value is `true`, to cancel when backspacing before where
  autocompletion started.

- - -

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

The behavior setting for case insensitive autocompletion when
  [`buffer.auto_c_ignore_case`](#auto_c_ignore_case) is `true`.

  * `_SCINTILLA.constants.SC_CASEINSENSITIVEBEHAVIOR_RESPECTCASE` (0)
    Prefer to select case-sensitive matches.
  * `_SCINTILLA.constants.SC_CASEINSENSITIVEBEHAVIOR_IGNORECASE` (1)
    No preference.

  The default value is `0`.

- - -

<a id="auto_c_choose_single"></a>
### `auto_c_choose_single` (bool)

Automatically choose the item in a single-item autocompletion list.
  The default value is `false`.

- - -

<a id="auto_c_current"></a>
### `auto_c_current` (number, Read-only)

The index of the currently selected item in the autocompletion list.

- - -

<a id="auto_c_current_text"></a>
### `auto_c_current_text` (string, Read-only)

The text of the currently selected item in the autocompletion list.

- - -

<a id="auto_c_drop_rest_of_word"></a>
### `auto_c_drop_rest_of_word` (bool)

Delete word characters after autocompleted text.
  The default value is `false`.

- - -

<a id="auto_c_fill_ups"></a>
### `auto_c_fill_ups` (string, Write-only)

A set of characters that choose the currently selected item in an
  autocompletion list when typed.
  The default value is an empty string.

- - -

<a id="auto_c_ignore_case"></a>
### `auto_c_ignore_case` (bool)

Ignore case when searching an autocompletion list for matches.
  The default value is `false`.

- - -

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

The maximum number of items to show in autocompletion and user lists. The
  default value is `5`.

- - -

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

The maximum number of characters per row to show in autocompletion and user
  lists.
  The default value is `0`, which automatically sizes the list to fit the
  longest item.

- - -

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

The order setting for autocompletion lists.

  * `_SCINTILLA.constants.SC_ORDER_PRESORTED` (0)
    Autocompletion lists passed to [`buffer.auto_c_show`](#auto_c_show) are
    in sorted alphabetical order.
  * `_SCINTILLA.constants.SC_ORDER_PERFORMSORT` (1)
    Scintilla should sort autocompletion lists passed to
    [`buffer.auto_c_show`](#auto_c_show).
  * `_SCINTILLA.constants.SC_ORDER_CUSTOM` (2)
    Autocompletion lists passed to [`buffer.auto_c_show`](#auto_c_show) are
    sorted in a custom order.

  The default value is `0`.

- - -

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

The character byte that separates autocompletion list items.
  The default value is `32` (' ').

- - -

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

The character byte that separates autocompletion list items and their
  image types.
  Autocompletion list items can display both an image and text. Register
  images and their types using [`buffer:register_image()`](#register_image)
  or [`buffer:register_rgba_image()`](#register_rgba_image) before appending
  image types to list items after type separator characters.
  The default value is 63 ('?').

- - -

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

Bit-mask of options for automatic folding behavior.

  * `_SCINTILLA.constants.SC_AUTOMATICFOLD_SHOW` (1)
    Automatically show lines as needed.
  * `_SCINTILLA.constants.SC_AUTOMATICFOLD_CLICK` (2)
    Handle clicks in the fold margin automatically.
  * `_SCINTILLA.constants.SC_AUTOMATICFOLD_CHANGE` (4)
    Show lines as needed when the fold structure changes.

  The default value is `0`.

- - -

<a id="back_space_un_indents"></a>
### `back_space_un_indents` (bool)

Un-indent text when backspacing within indentation.
  The default value is `false`.

- - -

<a id="buffered_draw"></a>
### `buffered_draw` (bool)

Buffer drawing to avoid flickering.
  Buffering draws each line of text into a bitmap buffer before drawing the
  bitmap to the screen.
  The default value is `true`.

- - -

<a id="call_tip_back"></a>
### `call_tip_back` (number, Write-only)

The background color, in "0xBBGGRR" format, for a call tip.

- - -

<a id="call_tip_fore"></a>
### `call_tip_fore` (number, Write-only)

The foreground color, in "0xBBGGRR" format, for a call tip.

- - -

<a id="call_tip_fore_hlt"></a>
### `call_tip_fore_hlt` (number, Write-only)

The foreground color, in "0xBBGGRR" format, for the highlighted part of a
  call tip.

- - -

<a id="call_tip_position"></a>
### `call_tip_position` (boolean)

Display the call tip above or below the text.
  The default value is `false` to display the call tip below the text.

- - -

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

The size in pixels of tab characters in call tips.
  When non-zero, also enables the use of `_SCINTILLA.constants.STYLE_CALLTIP`
  instead of `_SCINTILLA.constants.STYLE_DEFAULT` for call tip styles.
  The default value is `0`, which does not treat tab characters specially.

- - -

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

The foreground color, in "0xBBGGRR" format, of the caret.

- - -

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

The background color, in "0xBBGGRR" format, of the line containing the
  caret.

- - -

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

The background alpha value, ranging from `0` (transparent) to `255`
  (opaque), of the caret line.
  The default value is `256`, for no alpha.

- - -

<a id="caret_line_visible"></a>
### `caret_line_visible` (bool)

Color the background of the line containing the caret a different color.
  The default value is `false`.

- - -

<a id="caret_line_visible_always"></a>
### `caret_line_visible_always` (bool)

Always show the caret line, even when the window is not in focus.
  The default value is `false`, showing the line only when the window is in
  focus.

- - -

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

The time in milliseconds between caret blinks.
  A value of `0` stops blinking.
  The default value is `500`.

- - -

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

The preferred horizontal position of the caret when moving between lines.

  * `_SCINTILLA.constants.SC_CARETSTICKY_OFF` (0)
    Use the same position as on the previous line.
  * `_SCINTILLA.constants.SC_CARETSTICKY_ON` (1)
    Use the last position the caret was moved to via the mouse, left/right
    arrow keys, home/end keys, etc. Typing text does not affect the position.
  * `_SCINTILLA.constants.SC_CARETSTICKY_WHITESPACE` (2)
    Use the same position as on the previous line, but prior to any inserted
    indentation.

  The default value is `0`.

- - -

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

The style of caret to draw.

  * `_SCINTILLA.constants.CARETSTYLE_INVISIBLE` (0)
    No caret.
  * `_SCINTILLA.constants.CARETSTYLE_LINE` (1)
    A line caret.
  * `_SCINTILLA.constants.CARETSTYLE_BLOCK` (2)
    A block caret.

  The default value is `1`.

- - -

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

The pixel width of the caret in insert mode, either `0`, `1`, `2`, or `3`,
  and only applicable to line carets.
  The default value is `1`.

- - -

<a id="char_at"></a>
### `char_at` (table, Read-only)

Table of character bytes at positions in the buffer starting from zero.

- - -

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

The code page used to interpret buffer bytes as characters.

  + `0` None.
  + `932` Japanese Shift-JIS.
  + `936` Simplified Chinese GBK.
  + `949` Korean Unified Hangul Code.
  + `950` Traditional Chinese Big5.
  + `1361` Korean Johab.
  + `_SCINTILLA.constants.SC_CP_UTF8` (65001) UTF-8.

  The default value is `0`.

- - -

<a id="column"></a>
### `column` (table, Read-only)

Table of column numbers, taking tab widths into account, for positions in
  the buffer starting from zero.

- - -

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

The byte value of the character displayed in place of control characters,
  characters whose byte values are less than 32. Values less than 32 dispay
  ASCII mnemonics instead.
  The default value is `0`.

- - -

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

The position of the caret.
  When set, does not scroll the caret into view.

- - -

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

The cursor type.

  * `_SCINTILLA.constants.SC_CURSORNORMAL` (-1)
    The normal cursor.
  * `_SCINTILLA.constants.SC_CURSORWAIT` (4)
    The wait cursor.

  The default value is `-1`.

- - -

<a id="dirty"></a>
### `dirty` (bool)

Whether or not the buffer has unsaved changes.
  Unlike [`buffer.modify`](#modify), this field is accessible from any
  buffer, not just the global one.

- - -

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

The color, in "0xBBGGRR" format, used for the long line marker.

- - -

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

The column number to display the long line marker at.

- - -

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

The long line edge mode.

  * `_SCINTILLA.constants.EDGE_NONE` (0)
    Long lines are not marked.
  * `_SCINTILLA.constants.EDGE_LINE` (1)
    Draw a vertical line whose color is [`buffer.edge_colour`](#edge_colour)
    at column [`buffer.edge_column`](#edge_column).
  * `_SCINTILLA.constants.EDGE_BACKGROUND` (2)
    Change the background color of characters after column
    [`buffer.edge_column`](#edge_column) to
    [`buffer.edge_colour`](#edge_colour).

- - -

<a id="encoding"></a>
### `encoding` (string or nil)

The string encoding of the file on the hard drive or `nil` for binary
  files.

- - -

<a id="encoding_bom"></a>
### `encoding_bom` (string)

The byte-order mark, if any, of the file encoding.

- - -

<a id="end_at_last_line"></a>
### `end_at_last_line` (bool)

Disable scrolling past the last line.
  The default value is `true`.

- - -

<a id="end_styled"></a>
### `end_styled` (number, Read-only)

The position of the last correctly styled character.

- - -

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

The current end of line mode.

  * `_SCINTILLA.constants.SC_EOL_CRLF` (0)
    "CR+LF" ("\r\n").
  * `_SCINTILLA.constants.SC_EOL_CR` (1)
    "CR" ("\r").
  * `_SCINTILLA.constants.SC_EOL_LF` (2)
    "LF" ("\n").

  The default value is `0` on Windows platforms, `2` otherwise.

- - -

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

The amount of pixel padding above line text.
  The default value is `0`.

- - -

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

The amount of pixel padding below line text.
  The default is `0`.

- - -

<a id="filename"></a>
### `filename` (string)

The UTF-8-encoded absolute path to the file associated with the buffer.
  Use [`string.iconv()`][] and [`_G._CHARSET`][] for charset conversions.

  [`string.iconv()`]: string.html#iconv
  [`_G._CHARSET`]: _G.html#_CHARSET

- - -

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

The line number of the line at the top of the view, starting from zero.

- - -

<a id="fold_expanded"></a>
### `fold_expanded` (table)

Table of flags indicating whether or not folds are expanded for line
  numbers starting from zero.
  Setting expanded fold states does not toggle folds; it only updates fold
  margin markers. Use [`buffer:toggle_fold()`](#toggle_fold) instead.

- - -

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

Bit-mask of options for drawing folding lines.

  * `_SCINTILLA.constants.SC_FOLDFLAG_LINEBEFORE_EXPANDED` (2)
    Draw lines above expanded folds.
  * `_SCINTILLA.constants.SC_FOLDFLAG_LINEBEFORE_CONTRACTED` (4)
    Draw lines above collapsed folds.
  * `_SCINTILLA.constants.SC_FOLDFLAG_LINEAFTER_EXPANDED` (8)
    Draw lines below expanded folds.
  * `_SCINTILLA.constants.SC_FOLDFLAG_LINEAFTER_CONTRACTED` (16)
    Draw lines below collapsed folds.

  The default value is `0`.

- - -

<a id="fold_level"></a>
### `fold_level` (table)

Table of fold level bit-masks for line numbers starting from zero.
  Fold level masks are composed of an integer level combined with any of the
  following bits:

  * `_SCINTILLA.constants.SC_FOLDLEVELBASE` (0x400)
    The initial fold level.
  * `_SCINTILLA.constants.SC_FOLDLEVELWHITEFLAG` (0x1000)
    The line is blank.
  * `_SCINTILLA.constants.SC_FOLDLEVELHEADERFLAG` (0x2000)
    The line is a header, or fold point.

- - -

<a id="fold_parent"></a>
### `fold_parent` (table, Read-only)

Table of parent line numbers (fold points) for child line numbers starting
  from zero.
  A line number of `-1` means no line was found.

- - -

<a id="h_scroll_bar"></a>
### `h_scroll_bar` (bool)

Display the horizontal scroll bar.
  The default value is `true`.

- - -

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

The indentation guide column number to highlight, or `0` to stop
  highlighting.

- - -

<a id="hotspot_active_underline"></a>
### `hotspot_active_underline` (bool)

Underline active hotspots.
  The default value is `true`.

- - -

<a id="hotspot_single_line"></a>
### `hotspot_single_line` (bool)

Limit hotspots to a single line.
  The default value is `true`.

- - -

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

The number of spaces used for one level of indentation.
  The default value is `0`, which matches the tab size.

- - -

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

The indentation guide drawing mode.
  Indentation guides are dotted vertical lines that appear within indentation
  whitespace at each level of indentation.

  * `_SCINTILLA.constants.SC_IV_NONE` (0)
    Guides are not drawn.
  * `_SCINTILLA.constants.SC_IV_REAL` (1)
    Draw guides only within indentation whitespace.
  * `_SCINTILLA.constants.SC_IV_LOOKFORWARD` (2)
    Draw guides beyond the current line up to the level of the next non-empty
    line, but with an additional level if the previous non-empty line is a
    fold header.
  * `_SCINTILLA.constants.SC_IV_LOOKBOTH` (3)
    Draw guides beyond the current line up to either the level of the
    previous or next non-empty line, whichever is greater.

  The default value is `0`.

- - -

<a id="indic_alpha"></a>
### `indic_alpha` (table)

Table of fill color alpha values, ranging from `0` (transparent) to `255`
  (opaque), for indicator numbers from `0` to `31` whose styles are either
  `INDIC_ROUNDBOX`, `INDIC_STRAIGHTBOX`, or `INDIC_DOTBOX`.
  The default values are `256`, for no alpha.

- - -

<a id="indic_fore"></a>
### `indic_fore` (table)

Table of foreground colors, in "0xBBGGRR" format, for indicator numbers
  from `0` to `31`.

- - -

<a id="indic_outline_alpha"></a>
### `indic_outline_alpha` (table)

Table of outline color alpha values, ranging from `0` (transparent) to
  `255` (opaque), for indicator numbers from `0` to `31` whose styles are
  either `INDIC_ROUNDBOX`, `INDIC_STRAIGHTBOX`, or `INDIC_DOTBOX`.
  The default values are `256`, for no alpha.

- - -

<a id="indic_style"></a>
### `indic_style` (table)

Table of styles for indicator numbers from `0` to `31`.

  * `_SCINTILLA.constants.INDIC_PLAIN` (0)
    An underline.
  * `_SCINTILLA.constants.INDIC_SQUIGGLE` (1)
    A squiggly underline 3 pixels in height.
  * `_SCINTILLA.constants.INDIC_TT` (2)
    A line of small 'T' shapes.
  * `_SCINTILLA.constants.INDIC_DIAGONAL` (3)
    Diagonal hatching.
  * `_SCINTILLA.constants.INDIC_STRIKE` (4)
    Strike out.
  * `_SCINTILLA.constants.INDIC_HIDDEN` (5)
    Invisible.
  * `_SCINTILLA.constants.INDIC_BOX` (6)
    A rectangle around the text.
  * `_SCINTILLA.constants.INDIC_ROUNDBOX` (7)
    A translucent rectangle with rounded corners around the text. Use
    [`buffer.indic_alpha`](#indic_alpha) and
    [`buffer.indic_outline_alpha`](#indic_outline_alpha) to set the fill and
    outline transparency, respectively. Their default values are `30` and
    `50`.
  * `_SCINTILLA.constants.INDIC_STRAIGHTBOX` (8)
    Similar to `INDIC_ROUNDBOX` but with sharp corners.
  * `_SCINTILLA.constants.INDIC_DASH` (9)
    A dashed underline.
  * `_SCINTILLA.constants.INDIC_DOTS` (10)
    A dotted underline.
  * `_SCINTILLA.constants.INDIC_SQUIGGLELOW` (11)
    A squiggly underline 2 pixels in height.
  * `_SCINTILLA.constants.INDIC_DOTBOX` (12)
    Similar to `INDIC_STRAIGHTBOX` but with a dotted outline.
    Translucency alternates between [`buffer.indic_alpha`](#indic_alpha) and
    [`buffer.indic_outline_alpha`](#indic_outline_alpha) starting with the
    top-left pixel.
  * `_SCINTILLA.constants.INDIC_SQUIGGLEPIXMAP` (13)
    Identical to `INDIC_SQUIGGLE` but draws faster by using a pixmap instead
    of multiple line segments.
  * `_SCINTILLA.constants.INDIC_COMPOSITIONTHICK` (14)
    A 2-pixel thick underline at the bottom of the line inset by 1 pixel on
    on either side. Similar in appearance to Asian language input
    composition.

  Use [`_SCINTILLA.next_indic_number()`][] for custom indicators.

  [`_SCINTILLA.next_indic_number()`]: _SCINTILLA.html#next_indic_number

- - -

<a id="indic_under"></a>
### `indic_under` (table)

Table of flags indicating whether or not to draw indicators over text or
  under it for indicator numbers from `0` to `31`.
  For values to be `true`, [`buffer.two_phase_draw`](#two_phase_draw) must be
  `true`.
  The default values are `false` for drawing indicators over text.

- - -

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

The indicator number in the range of `0` to `31` used by
  [`buffer:indicator_fill_range()`](#indicator_fill_range) and
  [`buffer:indicator_clear_range()`](#indicator_clear_range).

- - -

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

The indicator value used for
  [`buffer:indicator_fill_range()`](#indicator_fill_range).
  Currently, all values are drawn the same, but it may be possible to draw
  different values in different styles in the future.

- - -

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

The layout cache mode.

  * `_SCINTILLA.constants.SC_CACHE_NONE` (0)
    No lines are cached.
  * `_SCINTILLA.constants.SC_CACHE_CARET` (1)
    Cache the line containing the caret.
  * `_SCINTILLA.constants.SC_CACHE_PAGE` (2)
    Cache visible lines.
  * `_SCINTILLA.constants.SC_CACHE_DOCUMENT` (3)
    Cache all lines in the buffer.

  The default value is `1`.

- - -

<a id="length"></a>
### `length` (number, Read-only)

The number of bytes in the buffer.

- - -

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

The numeric ID of the Scintilla lexer used by the buffer.

- - -

<a id="lexer_language"></a>
### `lexer_language` (string)

The name of the Scintilla lexer used by the buffer.
  You probably want to use [`buffer:get_lexer()`](#get_lexer) instead.

- - -

<a id="line_count"></a>
### `line_count` (number, Read-only)

The number of lines in the buffer.
  There is always at least one.

- - -

<a id="line_end_position"></a>
### `line_end_position` (table, Read-only)

Table of positions at the ends of lines, but before any end of line
  characters, for line numbers starting from zero.

- - -

<a id="line_indent_position"></a>
### `line_indent_position` (table, Read-only)

Table of positions at the ends of line indentation for line numbers
  starting from zero.

- - -

<a id="line_indentation"></a>
### `line_indentation` (table)

Table of line indentation amounts, measured in character columns, for line
  numbers starting from zero.

- - -

<a id="line_state"></a>
### `line_state` (table)

Table of integer line states for line numbers starting from zero.
  Line states are used for storing longer lived parse states per line. They
  are available in addition to the 8 bits of styling information per
  character.

- - -

<a id="line_visible"></a>
### `line_visible` (table, Read-only)

Table of flags indicating whether or not lines are visible for line numbers
  starting from zero.

- - -

<a id="lines_on_screen"></a>
### `lines_on_screen` (number, Read-only)

The number of completely visible lines in the view.
  It is possible to have a partial line visible at the bottom of the view.

- - -

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

The main, or most recent, selection.
  Only an existing selection can be made main.

- - -

<a id="margin_cursor_n"></a>
### `margin_cursor_n` (table)

Table of cursors shown for margin numbers from zero to four.

  * `_SCINTILLA.constants.SC_CURSORARROW` (2)
    Normal arrow cursor.
  * `_SCINTILLA.constants.SC_CURSORREVERSEARROW` (7)
    Reversed arrow cursor.

  The default values are `7`.

- - -

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

The size in pixels of the left margin of the buffer text.
  The default value is `1`.

- - -

<a id="margin_mask_n"></a>
### `margin_mask_n` (table)

Table of marker bit-masks for showing margin markers for margin numbers
  from zero to four.
  The default values are `0`, `0x1FFFFFF`, `0`, `0`, and `0`, for a line
  margin and logical marker margin.

- - -

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

A bit-mask of margin option settings.

  * `_SCINTILLA.constants.SC_MARGINOPTION_NONE` (0)
    None.
  * `_SCINTILLA.constants.SC_MARGINOPTION_SUBLINESELECT` (1)
    Select only the sub-line of the wrapped line on margin click.

  The default value is `0`.

- - -

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

The size in pixels of the right margin of the buffer text.
  The default value is `1`.

- - -

<a id="margin_sensitive_n"></a>
### `margin_sensitive_n` (table)

Table of flags indicating whether or not mouse clicks in margins emit
  `MARGIN_CLICK` events for margin numbers from zero to four.
  The default values are `false`.

- - -

<a id="margin_style"></a>
### `margin_style` (table)

Table of style numbers for text margin line numbers starting from zero.
  Only some style attributes are active in text margins: font,
  size/size_fractional, bold/weight, italics, fore, back, and character_set.

- - -

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

The beginning of the range of style numbers used for margin text.
  Margin styles may be completely separated from standard text styles by
  setting a style offset. For example, setting this to `256` would allow the
  margin styles to be numbered from `256` upto `511` so they do not overlap
  styles set by lexers. Each style number set with `margin_style` has
  the offset added before looking up the style.

- - -

<a id="margin_text"></a>
### `margin_text` (table)

Table of text in the text margin for line numbers starting from zero.

- - -

<a id="margin_type_n"></a>
### `margin_type_n` (table)

Table of margin types for margin numbers from zero to four.

  * `_SCINTILLA.constants.SC_MARGIN_SYMBOL` (0)
    A symbol margin.
  * `_SCINTILLA.constants.SC_MARGIN_NUMBER` (1)
    A line number margin.
  * `_SCINTILLA.constants.SC_MARGIN_BACK` (2)
    A symbol margin whose background color matches the default text
    background color.
  * `_SCINTILLA.constants.SC_MARGIN_FORE` (3)
    A symbol margin whose foreground color matches the default text
    foreground color.
  * `_SCINTILLA.constants.SC_MARGIN_TEXT` (4)
    A text margin.
  * `_SCINTILLA.constants.SC_MARGIN_RTEXT` (5)
    A right-justified text margin.

  The default values are `true`, `false`, `false`, `false`, and `false`, for
  a line number margin and symbol margins.

- - -

<a id="margin_width_n"></a>
### `margin_width_n` (table)

Table of margin widths in pixels for margin numbers from zero to four.

- - -

<a id="marker_alpha"></a>
### `marker_alpha` (table, Write-only)

Table of alpha values, ranging from `0` (transparent) to `255` (opaque),
  used for markers drawn in the text area, not the margin, for markers
  numbers from `0` to `31`.
  The default values are `256`, for no alpha.

- - -

<a id="marker_back"></a>
### `marker_back` (table, Write-only)

Table of background colors, in "0xBBGGRR" format, used for marker numbers
  from `0` to `31`.

- - -

<a id="marker_back_selected"></a>
### `marker_back_selected` (table, Write-only)

Table of background colors, in "0xBBGGRR" format, used for markers whose
  folding blocks are selected for marker numbers from `0` to `31`.
  The default values are `0x0000FF`.

- - -

<a id="marker_fore"></a>
### `marker_fore` (table, Write-only)

Table of foreground colors, in "0xBBGGRR" format, used for marker numbers
  from `0` to `31`.

- - -

<a id="max_line_state"></a>
### `max_line_state` (number, Read-only)

The last line number with a non-zero line state.

- - -

<a id="modify"></a>
### `modify` (bool)

Whether or not the buffer has unsaved changes.
  Unlike [`buffer.dirty`](#dirty), this field is accessible only from the
  global buffer.

- - -

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

The number of milliseconds the mouse must idle in order to generate a
  `DWELL_START` event, or `_SCINTILLA.constants.SC_TIME_FOREVER` to never
  generate one.

- - -

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

The multiple selection paste mode.

  * `_SCINTILLA.constants.SC_MULTIPASTE_ONCE` (0)
    Paste into only the main selection.
  * `_SCINTILLA.constants.SC_MULTIPASTE_EACH` (1)
    Paste into all selections.

  The default value is `0`.

- - -

<a id="multiple_selection"></a>
### `multiple_selection` (bool)

Enable multiple selection.
  The default value is `false`.

- - -

<a id="overtype"></a>
### `overtype` (bool)

Enable overtype mode, where typed characters overwrite existing ones.
  The default value is `false`.

- - -

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

The number of entries in the position cache.
  The position cache stores position information for short runs of text so
  that their layout can be determined more quickly if the run recurs.
  The default value is `1024`.

- - -

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

The print color mode.

  * `_SCINTILLA.constants.SC_PRINT_NORMAL` (0)
    Print with the current set of colors.
  * `_SCINTILLA.constants.SC_PRINT_INVERTLIGHT` (1)
    Print on a white background with the light values of the current color
    set.
    This mode is good for a dark background color.
  * `_SCINTILLA.constants.SC_PRINT_BLACKONWHITE` (2)
    Print black text on a white background.
  * `_SCINTILLA.constants.SC_PRINT_COLOURONWHITE` (3)
    Print on a white background with the current color set.
  * `_SCINTILLA.constants.SC_PRINT_COLOURONWHITEDEFAULTBG` (4)
    Print on a white background with the current color set except for line
    numbers which use their own background color.

- - -

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

The number of points to add to the size of each font when printing.
  Negative values are allowed.
  The default value is `0`.

- - -

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

The print line wrap mode.

  * `_SCINTILLA.constants.SC_WRAP_NONE` (0)
    Truncate long lines.
  * `_SCINTILLA.constants.SC_WRAP_WORD` (1)
    Wrap long lines at word boundaries if possible.
  * `_SCINTILLA.constants.SC_WRAP_CHAR` (2)
    Wrap long lines at character boundaries.

- - -

<a id="property"></a>
### `property` (table)

Map of key-value string pairs used by lexers.

- - -

<a id="property_expanded"></a>
### `property_expanded` (table, Read-only)

Map of key-value string pairs used by lexers with `$()` variable
  replacement performed in values.

- - -

<a id="property_int"></a>
### `property_int` (table, Read-only)

Map of key-value pairs used by lexers with values interpreted as numbers,
  or `0` if not found.

- - -

<a id="punctuation_chars"></a>
### `punctuation_chars` (string)

The set of characters considered to be punctuation characters.
  Set this only after setting [`buffer.word_chars`](#word_chars).
  The default value is a string containing all characters not considered to
  be whitespace or word characters.

- - -

<a id="read_only"></a>
### `read_only` (bool)

Whether or not the buffer is read-only.
  The default value is `false`.

- - -

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

The position of the anchor of the rectangular selection.

- - -

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

The amount of virtual space for the anchor of the rectangular selection.

- - -

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

The position of the caret of the rectangular selection.

- - -

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

The amount of virtual space for the caret of the rectangular selection.

- - -

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

The modifier key used in combination with a mouse drag to create a
  rectangular selection.

  * `_SCINTILLA.constants.SCMOD_CTRL` (2)
    The "Control" modifier key.
  * `_SCINTILLA.constants.SCMOD_ALT` (4)
    The "Alt" modifier key.
  * `_SCINTILLA.constants.SCMOD_SUPER` (8)
    The "Super" modifier key, usually defined as the left "Windows" or
    "Command" key.

  The default value is `2`.

- - -

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

The height for an RGBA image to be defined using
  [`buffer:marker_define_rgba_image()`](#marker_define_rgba_image).

- - -

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

The scale factor in percent for an RGBA image to be defined using
  [`buffer:marker_define_rgba_image()`](#marker_define_rgba_image).
  This is useful on OSX with a retina display where each display unit is 2
  pixels: use a factor of `200` so that each image pixel is dsplayed using a
  screen pixel. The default scale, `100`, will stretch each image pixel to
  cover 4 screen pixels on a retina display.

- - -

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

The width for an RGBA image to be defined using
  [`buffer:marker_define_rgba_image()`](#marker_define_rgba_image) and
  [`buffer:register_rgba_image()`](#register_rgba_image).

- - -

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

The assumed buffer width for horizontal scrolling purposes.
  For performance, the view does not measure the display width of the buffer
  to determine the properties of the horizontal scroll bar, but uses an
  assumed width instead. To ensure the width of the currently visible lines
  can be scrolled use
  [`buffer.scroll_width_tracking`](#scroll_width_tracking).
  The default value is `2000`.

- - -

<a id="scroll_width_tracking"></a>
### `scroll_width_tracking` (bool)

Set the scroll width to the maximum width of a displayed line beyond
  [`buffer.scroll_width`](#scroll_width).
  The default value is `false`.

- - -

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

The bit-mask of search flags used by
  [`buffer:search_in_target()`](#search_in_target).

  * `_SCINTILLA.constants.SCFIND_WHOLEWORD` (2)
    Match text surrounded by non-word characters.
  * `_SCINTILLA.constants.SCFIND_MATCHCASE` (4)
    Match text case sensitively.
  * `_SCINTILLA.constants.SCFIND_WORDSTART` (0x00100000)
    Match text when the previous character is a non-word character.
  * `_SCINTILLA.constants.SCFIND_REGEXP` (0x00200000)
    Interpret the search string as a regular expression.
  * `_SCINTILLA.constants.SCFIND_POSIX` (0x00400000)
    Interpret '(' and ')' as tags instead of "\\(" and "\\)" in a regular
    expression.

  The default value is `0`.

  Regular expression characters recognized are:

  * `.`
    Matches any character.
  * `[set]`
    Matches any character in *set*, including ranges (e.g. `[A-Za-z]`).
  * `[^set]`
    Matches the complement of *set*.
  * `*`
    Matches zero or more of the previous match.
  * `+`
    Matches one or more of the previous match.
  * `\<`
    Matches the beginning of a word.
    [`buffer.word_chars`](#word_chars) defines word characters.
  * `\>`
    Matches the end of a word.
    [`buffer.word_chars`](#word_chars) defines word characters.
  * `^`
    Matches the start of a line unless inside a set.
  * `$`
    Matches the end of a line unless inside a set.
  * `\(`
    The beginning of a tagged matching region.
  * `\)`
    The end of a tagged matching region.
  * `\n`
    The matched text of the *n*th tagged region. In replacement text, "\0" is
    all matched text.
  * `\x`
    Represents character *x*, ignoring any special meaning it may have by
    itself.

- - -

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

The alpha value, ranging from `0` (transparent) to `255` (opaque), of the
  selection.
  The default value is `256`, for no alpha.

- - -

<a id="sel_eol_filled"></a>
### `sel_eol_filled` (bool)

Extend the selection to the right margin of the view.
  The default value is `false`.

- - -

<a id="selection_empty"></a>
### `selection_empty` (bool, Read-only)

Whether or not no text is selected.

- - -

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

The position of the end of the selected text.
  When set, becomes the current position, but is not scrolled into view.

- - -

<a id="selection_is_rectangle"></a>
### `selection_is_rectangle` (bool, Read-only)

Whether or not the selection is a rectangular selection.

- - -

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

The selection mode.

  * `_SCINTILLA.constants.SC_SEL_STREAM` (0)
    Character selection.
  * `_SCINTILLA.constants.SC_SEL_RECTANGLE` (1)
    Rectangular selection.
  * `_SCINTILLA.constants.SC_SEL_LINES` (2)
    Line selection.
  * `_SCINTILLA.constants.SC_SEL_THIN` (3)
    Thin rectangular selection. This is the mode after a rectangular
    selection has been typed into and ensures that no characters are
    selected.

  When set, caret movement alters the selected text until this field is set
  again to the same value or [`buffer:cancel()`](#cancel) is called.

- - -

<a id="selection_n_anchor"></a>
### `selection_n_anchor` (table)

Table of anchor positions for existing selections numbered from zero, the
  main selection.

- - -

<a id="selection_n_anchor_virtual_space"></a>
### `selection_n_anchor_virtual_space` (table)

Table of the amount of virtual space for anchors for existing selections
  numbered from zero, the main selection.

- - -

<a id="selection_n_caret"></a>
### `selection_n_caret` (table)

Table of caret positions for existing selections numbered from zero, the
  main selection.

- - -

<a id="selection_n_caret_virtual_space"></a>
### `selection_n_caret_virtual_space` (table)

Table of the amount of virtual space for carets for existing selections
  numbered from zero, the main selection.

- - -

<a id="selection_n_end"></a>
### `selection_n_end` (table)

Table of positions at the end of existing selections numbered from zero,
  the main selection.

- - -

<a id="selection_n_start"></a>
### `selection_n_start` (table)

Table of positions at the beginning of existing selections numbered from
  zero, the main selection.

- - -

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

The position of the beginning of the selected text.
  When set, becomes the anchor, but is not scrolled into view.

- - -

<a id="selections"></a>
### `selections` (number, Read-only)

The number of active selections.

- - -

<a id="style_at"></a>
### `style_at` (table, Read-only)

Table of style bytes at positions in the buffer starting from zero.

- - -

<a id="style_back"></a>
### `style_back` (table)

Table of background colors, in "0xBBGGRR" format, for style numbers from
  `0` to `255`.

- - -

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

The number of bits in an 8-bit style byte to use for styling.
  The number of styling bits required by the current lexer is
  [`buffer.style_bits_needed`](#style_bits_needed).
  The default value is `5`.

- - -

<a id="style_bits_needed"></a>
### `style_bits_needed` (number, Read-only)

The number of styling bits required by the current lexer.

- - -

<a id="style_bold"></a>
### `style_bold` (table)

Table of flags indicating whether or not text within styles has a bold font
  face for style numbers from `0` to `255`.
  The default values are `false`.

- - -

<a id="style_case"></a>
### `style_case` (table)

Table of letter case modes for text within styles for style numbers from
  `0` to `255`.

  * `_SCINTILLA.constants.SC_CASE_MIXED` (0)
    Display text in mixed case.
  * `_SCINTILLA.constants.SC_CASE_UPPER` (1)
    Display text in upper case.
  * `_SCINTILLA.constants.SC_CASE_LOWER` (2)
    Display text in lower case.

  The default values are `0`.

- - -

<a id="style_changeable"></a>
### `style_changeable` (table)

Table of flags indicating whether or not text within styles is changeable
  for style numbers from `0` to `255`.
  The default values are `true`.
  Currently, read-only styles do not allow the caret into the range of text,
  but ranges containing read-only text are deletable.

- - -

<a id="style_character_set"></a>
### `style_character_set` (table)

Table of character sets for style numbers from `0` to `255`.

  * `_SCINTILLA.constants.SC_CHARSET_ANSI` (0)
  * `_SCINTILLA.constants.SC_CHARSET_DEFAULT` (1)
  * `_SCINTILLA.constants.SC_CHARSET_CYRILLIC` (1251)
  * `_SCINTILLA.constants.SC_CHARSET_EASTEUROPE` (238)
  * `_SCINTILLA.constants.SC_CHARSET_GB2312` (134)
  * `_SCINTILLA.constants.SC_CHARSET_HANGUL` (129)
  * `_SCINTILLA.constants.SC_CHARSET_RUSSIAN` (204)
  * `_SCINTILLA.constants.SC_CHARSET_SHIFTJIS` (128)
  * `_SCINTILLA.constants.SC_CHARSET_8859_15` (1000)

  The default values are `1`.

- - -

<a id="style_eol_filled"></a>
### `style_eol_filled` (table)

Table of flags indicating whether or not to extend the background colors of
  styles whose characters occur last on lines all the way to the right margin
  of the view for style numbers from `0` to `255`.
  The default values are `false`.

- - -

<a id="style_font"></a>
### `style_font` (table)

Table of font faces for style numbers from `0` to `255`.

- - -

<a id="style_fore"></a>
### `style_fore` (table)

Table of foreground colors, in "0xBBGGRR" format, for style numbers from
  `0` to `255`.

- - -

<a id="style_hot_spot"></a>
### `style_hot_spot` (table)

Table of flags indicating whether or not text within styles is clickable
  for style numbers from `0` to `255`.
  The default values are `false`.

- - -

<a id="style_italic"></a>
### `style_italic` (table)

Table of flags indicating whether or not text within styles has an italic
  font face for style numbers from `0` to `255`.
  The default values are `false`.

- - -

<a id="style_size"></a>
### `style_size` (table)

Table of font sizes, expressed in whole number points, for style numbers
  from `0` to `255`.

- - -

<a id="style_size_fractional"></a>
### `style_size_fractional` (table)

Table of character sizes, expressed in hundredths of a point, for style
  numbers from `0` to `255`.
  For example, a text size of 9.4 points is set using `940`.

- - -

<a id="style_underline"></a>
### `style_underline` (table)

Table of flags indicating whether or not text within styles has an
  underlined font face for style numbers from `0` to `255`.
  The default values are `false`.

- - -

<a id="style_visible"></a>
### `style_visible` (table)

Table of flags indicating whether or not text within styles is visible for
  style numbers from `0` to `255`.
  The default values are `true`.

- - -

<a id="style_weight"></a>
### `style_weight` (table)

Table of character weights ranging from `1` (very light) to `999` (very
  heavy) for text within styles for style numbers from `0` to `255`.
  However, most fonts only support a small number of weights:

  * `_SCINTILLA.constants.SC_WEIGHT_NORMAL` (400)
    Normal.
  * `_SCINTILLA.constants.SC_WEIGHT_SEMIBOLD` (600)
    Semi-bold.
  * `_SCINTILLA.constants.SC_WEIGHT_BOLD` (700)
    Bold.

  The default values are `400`.

- - -

<a id="tab_indents"></a>
### `tab_indents` (bool)

Tabbing indents within indentation.
  The default value is `false`.

- - -

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

The number of space characters represented by a tab character.
  The default value is `8`.

- - -

<a id="tag"></a>
### `tag` (table)

List of tag match values from a regular expression search.

- - -

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

The position of the end of the target range.
  This is also set by a successful
  [`buffer:search_in_target()`](#search_in_target).

- - -

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

The position of the beginning of the target range.
  This is also set by a successful
  [`buffer:search_in_target()`](#search_in_target).

- - -

<a id="text_length"></a>
### `text_length` (number, Read-only)

The number of characters in the buffer.

- - -

<a id="two_phase_draw"></a>
### `two_phase_draw` (bool)

Draw in two phases: first the background and then the foreground.
  The default is `true`.

- - -

<a id="undo_collection"></a>
### `undo_collection` (bool)

Collect undo information.
  When setting to `false`, call
  [`buffer:empty_undo_buffer()`](#empty_undo_buffer) to avoid desynchronizing
  the undo buffer with the buffer text.
  The default value is `true`.

- - -

<a id="use_tabs"></a>
### `use_tabs` (bool)

Use tabs or spaces in indentation.
  The default value is `true`, for using tabs.

- - -

<a id="v_scroll_bar"></a>
### `v_scroll_bar` (bool)

Display the vertical scroll bar.
  The default value is `true`.

- - -

<a id="view_eol"></a>
### `view_eol` (bool)

Display end of line characters.
  The default value is `false`.

- - -

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

The whitespace character visibility mode.

  * `_SCINTILLA.constants.SCWS_INVISIBLE` (0)
    Whitespace is invisible.
  * `_SCINTILLA.constants.SCWS_VISIBLEALWAYS` (1)
    Display whitespace as dots and arrows.
  * `_SCINTILLA.constants.SCWS_VISIBLEAFTERINDENT` (2)
    Display non-indentation whitespace as dots and arrows.

  The default value is `0`.

- - -

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

The virtual space mode.

  * `_SCINTILLA.constants.SCVS_NONE` (0)
    Disable virtual space.
  * `_SCINTILLA.constants.SCVS_RECTANGULARSELECTION` (1)
    Enable virtual space only for rectangular selections.
  * `_SCINTILLA.constants.SCVS_USERACCESSIBLE` (2)
    Enable virtual space.

  The default value is `0`.

- - -

<a id="whitespace_chars"></a>
### `whitespace_chars` (string)

The set of characters considered to be whitespace characters when moving
  or selecting text by word.
  Set this only after setting [`buffer.word_chars`](#word_chars).
  The default value is a string containing all non-newline characters less
  than ASCII value 33.

- - -

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

The size of the dots in pixels used to represent space characters when
  whitespace is visible.
  The default value is `1`.

- - -

<a id="word_chars"></a>
### `word_chars` (string)

The set of characters considered to be word characters when moving or
  selecting text by word.
  The default value is a string containing alphanumeric characters, an
  underscore, and all characters greater than ASCII value 127.

- - -

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

The wrapped line indent mode.

  * `_SCINTILLA.constants.SC_WRAP_INDENT_FIXED` (0)
    Indent wrapped lines by [`buffer.wrap_start_indent`](#wrap_start_indent).
  * `_SCINTILLA.constants.SC_WRAP_INDENT_SAME` (1)
    Indent wrapped lines the same as the first line.
  * `_SCINTILLA.constants.SC_WRAP_INDENT_INDENT` (2)
    Indent wrapped lines one more level than the first line.

  The default value is `0`.

- - -

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

Long line wrap mode.

  * `_SCINTILLA.constants.SC_WRAP_NONE` (0)
    Long lines are not wrapped.
  * `_SCINTILLA.constants.SC_WRAP_WORD` (1)
    Wrap long lines at word boundaries.
  * `_SCINTILLA.constants.SC_WRAP_CHAR` (2)
    Wrap long lines at character boundaries.

  The default value is `0`.

- - -

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

The number of spaces to indent wrapped lines by if
  [`buffer.wrap_indent_mode`](#wrap_indent_mode) is
  `_SCINTILLA.constants.SC_WRAP_INDENT_FIXED`.
  The default value is `0`.

- - -

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

The wrapped line visual display mode.

  * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_NONE` (0)
    No visual flags.
  * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_END` (1)
    Show visual flag at the end of the line.
  * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_START` (2)
    Show visual flag at the beginning of the sub-line.
  * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_MARGIN` (4)
    Show visual flag in the line number margin of the sub-line.

  The default value is `0`.

- - -

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

The wrapped line visual flag drawing mode.

  * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_DEFAULT` (0)
    Draw the visual flag near the right border.
  * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_END_BY_TEXT` (1)
    Draw the visual flag near text at the end of the line.
  * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_START_BY_TEXT` (2)
    Draw the visual flag near text at the beginning of the subline.

  The default value is `0`.

- - -

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

The horizontal scroll position in pixels.
  A value of `0` is the normal position with the first text column visible at
  the left of the view.

- - -

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

The number of points to add to the size of all fonts.
  Negative values are allowed.
  The default value is `0`.

- - -


## Functions

- - -

<a id="add_selection"></a>
### `add_selection`(*buffer, caret, anchor*)

Selects the change of text from *anchor* to *caret* as the main selection,
retaining all other selections as additional selections.
Even if no text is selected, the current position counts as an empty
selection. Use `buffer:set_selection()` first when setting a list of
selections.

Parameters:

* *`buffer`*: The global buffer.
* *`caret`*: The caret position of the range of text to select in *buffer*.
* *`anchor`*: The anchor position of the range of text to select in *buffer*.

- - -

<a id="add_text"></a>
### `add_text`(*buffer, text*)

Adds string *text* to the buffer at the caret and moves the caret to the end
of the added text, but does not scroll it into view.

Parameters:

* *`buffer`*: The global buffer.
* *`text`*: The text to add.

- - -

<a id="allocate"></a>
### `allocate`(*buffer, bytes*)

Enlarges the buffer to store *bytes* number of bytes, but never shrinks it
beyond the size of its contents.

Parameters:

* *`buffer`*: The global buffer.
* *`bytes`*: The number of bytes *buffer* can store.

- - -

<a id="annotation_clear_all"></a>
### `annotation_clear_all`(*buffer*)

Clears annotations from all lines.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="append_text"></a>
### `append_text`(*buffer, text*)

Appends string *text* to the end of the buffer without changing the selected
text or scrolling the text into view.

Parameters:

* *`buffer`*: The global buffer.
* *`text`*: The text to append.

- - -

<a id="auto_c_active"></a>
### `auto_c_active`(*buffer*)

Returns whether or not an autocompletion list is visible.

Parameters:

* *`buffer`*: The global buffer.

Return:

* bool

- - -

<a id="auto_c_cancel"></a>
### `auto_c_cancel`(*buffer*)

Cancels the autocompletion list.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="auto_c_complete"></a>
### `auto_c_complete`(*buffer*)

Autocompletes the selected word in the list.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="auto_c_pos_start"></a>
### `auto_c_pos_start`(*buffer*)

Returns the position where autocompletion started at.

Parameters:

* *`buffer`*: The global buffer.

Return:

* number

- - -

<a id="auto_c_select"></a>
### `auto_c_select`(*buffer, string*)

Selects the first item in the autocompletion list that starts with *string*,
considering case sensitiveness depending on `buffer.auto_c_ignore_case`.

Parameters:

* *`buffer`*: The global buffer.
* *`string`*: The item in the list to select.

- - -

<a id="auto_c_show"></a>
### `auto_c_show`(*buffer, len\_entered, item\_list*)

Displays an autocompletion list from *item_list*, a sorted string whose items
are delimited by `buffer.auto_c_separator` characters, using *len_entered*
number of characters behind the caret as the prefix of the word to
autocomplete.
The sorted order of *item_list*, `buffer.auto_c_order`, must be already
defined.

Parameters:

* *`buffer`*: The global buffer.
* *`len_entered`*: The number of characters before the caret used to provide
  the context.
* *`item_list`*: The sorted string of words to show, separated by
  `buffer.auto_c_separator` characters (initially spaces).

- - -

<a id="auto_c_stops"></a>
### `auto_c_stops`(*buffer, chars*)

Defines *chars* as the set of characters that cancel autocompletion when
typed.
The default set is an empty string.

Parameters:

* *`buffer`*: The global buffer.
* *`chars`*: The string of characters that cancel autocompletion. This string
  is empty by default.

- - -

<a id="back_tab"></a>
### `back_tab`(*buffer*)

Dedents the selected lines.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="begin_undo_action"></a>
### `begin_undo_action`(*buffer*)

Starts a sequence of actions to undo or redo as a single action.
May be nested.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="brace_bad_light"></a>
### `brace_bad_light`(*buffer, pos*)

Highlights the character at position *pos* as an unmatched brace character in
the `_SCINTILLA.constants.STYLE_BRACEBAD` style.
Removes highlighting when *pos* is `-1`.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position in *buffer* to highlight, or `-1` to remove the
  highlight.

- - -

<a id="brace_bad_light_indicator"></a>
### `brace_bad_light_indicator`(*buffer, use\_indicator, indic\_num*)

Highlights unmatched brace characters with indicator number *indic_num*, in
the range of `0` to `31`, instead of the
`_SCINTILLA.constants.STYLE_BRACEBAD` style if *use_indicator* is `true`.

Parameters:

* *`buffer`*: The global buffer.
* *`use_indicator`*: Whether or not to use an indicator.
* *`indic_num`*: The indicator number to use.

- - -

<a id="brace_highlight"></a>
### `brace_highlight`(*buffer, pos1, pos2*)

Highlights the characters at positions *pos1* and *pos2* as matching braces
in the `_SCINTILLA.constants.STYLE_BRACELIGHT` style.
If indent guides are enabled, locate the column with `buffer.column` and
set `buffer.highlight_guide` in order to highlight the indent guide.

Parameters:

* *`buffer`*: The global buffer.
* *`pos1`*: The first position in *buffer* to highlight.
* *`pos2`*: The second position in *buffer* to highlight.

- - -

<a id="brace_highlight_indicator"></a>
### `brace_highlight_indicator`(*buffer, use\_indicator, indic\_num*)

Highlights matching brace characters with indicator number *indic_num*, in
the range of `0` to `31`, instead of the
`_SCINTILLA.constants.STYLE_BRACELIGHT` style if *use_indicator* is `true`.

Parameters:

* *`buffer`*: The global buffer.
* *`use_indicator`*: Whether or not to use an indicator.
* *`indic_num`*: The indicator number to use.

- - -

<a id="brace_match"></a>
### `brace_match`(*buffer, pos*)

Returns the position of the matching brace for the brace character at
position *pos*, taking nested braces into account, or `-1`.
The brace characters recognized are '(', ')', '[', ']', '{', '}', '<', and
'>' and must have the same style.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position of the brace in *buffer* to match.

Return:

* number.

- - -

<a id="call_tip_active"></a>
### `call_tip_active`(*buffer*)

Returns whether or not a call tip is visible.

Parameters:

* *`buffer`*: The global buffer.

Return:

* bool

- - -

<a id="call_tip_cancel"></a>
### `call_tip_cancel`(*buffer*)

Removes the call tip from view.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="call_tip_pos_start"></a>
### `call_tip_pos_start`(*buffer*)

Returns the position where the call tip displayed at.

Parameters:

* *`buffer`*: The global buffer.

Return:

* number

- - -

<a id="call_tip_set_hlt"></a>
### `call_tip_set_hlt`(*buffer, start\_pos, end\_pos*)

Highlights call tip text from *start_pos*, starting from zero, to *end_pos*
with the color `buffer.call_tip_fore_hlt`.

Parameters:

* *`buffer`*: The global buffer.
* *`start_pos`*: The start position in the call tip text to highlight.
* *`end_pos`*: The end position in the call tip text to highlight.

- - -

<a id="call_tip_show"></a>
### `call_tip_show`(*buffer, pos, text*)

Displays a call tip containing string *text* for the word behind position
*pos*.
Any "\001" or "\002" bytes in *text* are replaced by arrow visuals,
indicating the word has more than one call tip.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position in *buffer* to show the call tip at.
* *`text`*: The call tip text to show.

- - -

<a id="can_paste"></a>
### `can_paste`(*buffer*)

Returns whether or not the clipboard has text to paste.

Parameters:

* *`buffer`*: The global buffer.

Return:

* bool

- - -

<a id="can_redo"></a>
### `can_redo`(*buffer*)

Returns whether or not there is an action to redo.

Parameters:

* *`buffer`*: The global buffer.

Return:

* bool

- - -

<a id="can_undo"></a>
### `can_undo`(*buffer*)

Returns whether or not there is an action to undo.

Parameters:

* *`buffer`*: The global buffer.

Return:

* bool

- - -

<a id="cancel"></a>
### `cancel`(*buffer*)

Cancels the active call tip, autocompletion list, user list, selection mode,
etc.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="change_lexer_state"></a>
### `change_lexer_state`(*buffer, start\_pos, end\_pos*)

Tells the lexer to re-process the range of text from *start_pos* to
*end_pos*.

Parameters:

* *`buffer`*: The global buffer.
* *`start_pos`*: The start position of the range of text in *buffer* to
  re-process.
* *`end_pos`*: The end position of the range of text in *buffer* to
  re-process.

- - -

<a id="char_left"></a>
### `char_left`(*buffer*)

Moves the caret left one character.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="char_left_extend"></a>
### `char_left_extend`(*buffer*)

Moves the caret left one character, extending the selected text to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="char_left_rect_extend"></a>
### `char_left_rect_extend`(*buffer*)

Moves the caret left one character, extending the rectangular selection to
the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="char_position_from_point"></a>
### `char_position_from_point`(*buffer, x, y*)

Returns the character position closest to view coordinates *x* and *y*.

Parameters:

* *`buffer`*: The global buffer.
* *`x`*: The x-coordinate in the view to use.
* *`y`*: The y-coordinate in the view to use.

Return:

* number

- - -

<a id="char_position_from_point_close"></a>
### `char_position_from_point_close`(*buffer, x, y*)

Returns the character position closest to view coordinates *x* and *y*, or
`-1` if the point is outside the window or not close to any text.

Parameters:

* *`buffer`*: The global buffer.
* *`x`*: The x-coordinate in the view to use.
* *`y`*: The y-coordinate in the view to use.

Return:

* number

- - -

<a id="char_right"></a>
### `char_right`(*buffer*)

Moves the caret right one character.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="char_right_extend"></a>
### `char_right_extend`(*buffer*)

Moves the caret right one character, extending the selected text to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="char_right_rect_extend"></a>
### `char_right_rect_extend`(*buffer*)

Moves the caret right one character, extending the rectangular selection to
the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="check_global"></a>
### `check_global`(*buffer*)

Ensures the buffer is the global one, `_G.buffer`, throwing an error
otherwise.
This function must be called in all buffer functions because only the global
buffer can be worked with.

Parameters:

* *`buffer`*: The buffer to check.

See also:

* [`_G.buffer`](_G.html#buffer)

- - -

<a id="choose_caret_x"></a>
### `choose_caret_x`(*buffer*)

Sets the preferred horizontal position of the caret when moving between
lines to the current position.

Parameters:

* *`buffer`*: The global buffer.

See also:

* [`caret_sticky`](#caret_sticky)

- - -

<a id="clear"></a>
### `clear`(*buffer*)

Deletes the selected text or the character at the caret.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="clear_all"></a>
### `clear_all`(*buffer*)

Deletes all of the text in the buffer unless the buffer is read-only.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="clear_all_cmd_keys"></a>
### `clear_all_cmd_keys`(*buffer*)

Clears Scintilla's internal key bindings.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="clear_document_style"></a>
### `clear_document_style`(*buffer*)

Clears all styling and folding information in the buffer.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="clear_registered_images"></a>
### `clear_registered_images`(*buffer*)

Clears all images registered using `buffer:register_image()` and
`buffer:register_rgba_image()`.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="clear_selections"></a>
### `clear_selections`(*buffer*)

Removes all selections and moves the caret to the beginning of the buffer.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="close"></a>
### `close`(*buffer*)

Closes the buffer, prompting the user to continue if there are unsaved
changes, and returns `true` if the buffer was closed.

Parameters:

* *`buffer`*: The global buffer.

Return:

* `true` if the buffer was closed; `nil` otherwise.

- - -

<a id="colourise"></a>
### `colourise`(*buffer, start\_pos, end\_pos*)

Tells the lexer to style and fold the range of text from *start_pos* to
*end_pos*.
If *end_pos* is `-1`, styles and folds to the end of the buffer.

Parameters:

* *`buffer`*: The global buffer.
* *`start_pos`*: The start position of the range of text in *buffer* to
  process.
* *`end_pos`*: The end position of the range of text in *buffer* to process,
  or `-1` to process from *start_pos* to the end of *buffer*.

- - -

<a id="contracted_fold_next"></a>
### `contracted_fold_next`(*buffer, line\_start*)

Returns the line number of the next contracted fold header line starting at
*line_start*, or `-1`.

Parameters:

* *`buffer`*: The global buffer.
* *`line_start`*: The line number in *buffer* to start at.

Return:

* number

- - -

<a id="convert_eo_ls"></a>
### `convert_eo_ls`(*buffer, mode*)

Converts all line endings to end of line mode *mode*.

Parameters:

* *`buffer`*: The global buffer.
* *`mode`*: The line ending mode to convert to. Valid values are:
  * `_SCINTILLA.constants.SC_EOL_CRLF` (0)
  * `_SCINTILLA.constants.SC_EOL_CR` (1)
  * `_SCINTILLA.constants.SC_EOL_LF` (2)

- - -

<a id="copy"></a>
### `copy`(*buffer*)

Copies the selected text to the clipboard.
Multiple selections are copied in order with no delimiters. Rectangular
selections are copied from top to bottom with line ending delimiters. Virtual
space is not copied.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="copy_allow_line"></a>
### `copy_allow_line`(*buffer*)

Copies the selected text or the current line to the clipboard.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="copy_range"></a>
### `copy_range`(*buffer, start\_pos, end\_pos*)

Copies the range of text from *start_pos* to *end_pos* to the clipboard.

Parameters:

* *`buffer`*: The global buffer.
* *`start_pos`*: The start position of the range of text in *buffer* to copy.
* *`end_pos`*: The end position of the range of text in *buffer* to copy.

- - -

<a id="copy_text"></a>
### `copy_text`(*buffer, text*)

Copies string *text* to the clipboard.

Parameters:

* *`buffer`*: The global buffer.
* *`text`*: The text to copy.

- - -

<a id="count_characters"></a>
### `count_characters`(*buffer, start\_pos, end\_pos*)

Returns the number of whole characters in-between positions *start_pos* and
*end_pos*.

Parameters:

* *`buffer`*: The global buffer.
* *`start_pos`*: The start position of the range of text in *buffer* to start
  counting at.
* *`end_pos`*: The end position of the range of text in *buffer* to stop
  counting at.

Return:

* number

- - -

<a id="cut"></a>
### `cut`(*buffer*)

Cuts the selected text to the clipboard.
Multiple selections are copied in order with no delimiters. Rectangular
selections are copied from top to bottom with line ending delimiters. Virtual
space is not copied.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="del_line_left"></a>
### `del_line_left`(*buffer*)

Deletes text from the caret to the beginning of the line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="del_line_right"></a>
### `del_line_right`(*buffer*)

Deletes text from the caret to the end of the line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="del_word_left"></a>
### `del_word_left`(*buffer*)

Deletes the word to the left of the caret, including any leading non-word
characters.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="del_word_right"></a>
### `del_word_right`(*buffer*)

Deletes the word to the right of the caret, including any trailing non-word
characters.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="del_word_right_end"></a>
### `del_word_right_end`(*buffer*)

Deletes the word to the right of the caret, excluding any trailing non-word
characters.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="delete"></a>
### `delete`(*buffer*)

Deletes the buffer.
**Do not call this function.** Call `buffer:close()` instead. Emits a
`BUFFER_DELETED` event.

Parameters:

* *`buffer`*: The global buffer.

See also:

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

- - -

<a id="delete_back"></a>
### `delete_back`(*buffer*)

Deletes the selected text or the character behind the caret.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="delete_back_not_line"></a>
### `delete_back_not_line`(*buffer*)

Deletes the selected text or the character behind the caret unless the caret
is at the beginning of a line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="delete_range"></a>
### `delete_range`(*buffer, pos, length*)

Deletes the range of text from *pos* to *pos* + *length* in the buffer.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The start position of the range of text in *buffer* to delete.
* *`length`*: The number of characters in the range of text to delete.

- - -

<a id="doc_line_from_visible"></a>
### `doc_line_from_visible`(*buffer, display\_line*)

Returns the actual line number of displayed line number *display_line*,
taking hidden lines into account.
If *display_line* is less than or equal to zero, returns `0`. If
*display_line* is greater than or equal to the number of displayed lines,
returns `buffer.line_count`.

Parameters:

* *`buffer`*: The global buffer.
* *`display_line`*: The display line number to use.

Return:

* number

- - -

<a id="document_end"></a>
### `document_end`(*buffer*)

Moves the caret to the end of the buffer.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="document_end_extend"></a>
### `document_end_extend`(*buffer*)

Moves the caret to the end of the buffer, extending the selected text to the
new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="document_start"></a>
### `document_start`(*buffer*)

Moves the caret to the beginning of the buffer.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="document_start_extend"></a>
### `document_start_extend`(*buffer*)

Moves the caret to the beginning of the buffer, extending the selected text
to the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="edit_toggle_overtype"></a>
### `edit_toggle_overtype`(*buffer*)

Toggles `buffer.overtype`.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="empty_undo_buffer"></a>
### `empty_undo_buffer`(*buffer*)

Deletes the undo and redo history and sets `buffer.modify` to `false`.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="encoded_from_utf8"></a>
### `encoded_from_utf8`(*buffer, string*)

Returns the result of UTF-8-encoded string *string* converted into the
buffer's encoding.

Parameters:

* *`buffer`*: The global buffer.
* *`string`*: The UTF-8-encoded string to convert.

Return:

* number

- - -

<a id="end_undo_action"></a>
### `end_undo_action`(*buffer*)

Ends a sequence of actions to undo or redo as a single action.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="ensure_visible"></a>
### `ensure_visible`(*buffer, line*)

Ensures line number *line* is visible by expanding any fold header lines
hiding it.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to ensure visible.

- - -

<a id="ensure_visible_enforce_policy"></a>
### `ensure_visible_enforce_policy`(*buffer, line*)

Ensures line number *line* is visible by expanding any fold header lines
hiding it and applies the vertical caret policy set with
`buffer:set_visible_policy()`.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to ensure visible.

- - -

<a id="expand_children"></a>
### `expand_children`(*buffer, line, level*)

Expands the fold states of the fold header on line number *line* and its
children with fold level *level*.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to expand the folds for.
* *`level`*: The previous fold level of *line*, not the current one. This is
  because this function is used to respond to changes in a line's fold level
  or fold header status, so a new fold level has already been set.

- - -

<a id="find_column"></a>
### `find_column`(*buffer, line, column*)

Returns the position of column number *column* on line number *line*, taking
tab and multi-byte characters into account, or the position at the end of
line *line*.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to use.
* *`column`*: The column number to use.

- - -

<a id="fold_all"></a>
### `fold_all`(*buffer, action*)

Expands, contracts, or toggles the fold states of all fold headers in the
buffer, depending on *action*.
When toggling, the state of the first fold header in the buffer determines
whether to expand or contract.

Parameters:

* *`buffer`*: The global buffer.
* *`action`*: The fold action to perform. Valid values are:
  * `_SCINTILLA.constants.SC_FOLDACTION_CONTRACT` (0)
  * `_SCINTILLA.constants.SC_FOLDACTION_EXPAND` (1)
  * `_SCINTILLA.constants.SC_FOLDACTION_TOGGLE` (2)

- - -

<a id="fold_children"></a>
### `fold_children`(*buffer, line, action*)

Expands, contracts, or toggles the fold states of the fold header on line
number *line* and its children, depending on *action*.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to set the fold states for.
* *`action`*: The fold action to perform. Valid values are:
  * `_SCINTILLA.constants.SC_FOLDACTION_CONTRACT` (0)
  * `_SCINTILLA.constants.SC_FOLDACTION_EXPAND` (1)
  * `_SCINTILLA.constants.SC_FOLDACTION_TOGGLE` (2)

- - -

<a id="fold_line"></a>
### `fold_line`(*buffer, line, action*)

Expands, contracts, or toggles the fold state of the fold header on line
number *line*, depending on *action*.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to set the fold state for.
* *`action`*: The fold action to perform. Valid values are:
  * `_SCINTILLA.constants.SC_FOLDACTION_CONTRACT` (0)
  * `_SCINTILLA.constants.SC_FOLDACTION_EXPAND` (1)
  * `_SCINTILLA.constants.SC_FOLDACTION_TOGGLE` (2)

- - -

<a id="form_feed"></a>
### `form_feed`(*buffer*)

Inserts a Form Feed ("\f") character at the caret.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="get_cur_line"></a>
### `get_cur_line`(*buffer*)

Returns the current line's text and the index of the caret on the line,
starting from zero.

Parameters:

* *`buffer`*: The global buffer.

Return:

* string, number

- - -

<a id="get_hotspot_active_back"></a>
### `get_hotspot_active_back`(*buffer*)

Returns the numeric background color for active hotspots.

Parameters:

* *`buffer`*: The global buffer.

Return:

* number

- - -

<a id="get_hotspot_active_fore"></a>
### `get_hotspot_active_fore`(*buffer*)

Returns the numeric foreground color for active hotspots.

Parameters:

* *`buffer`*: The global buffer.

Return:

* number

- - -

<a id="get_last_child"></a>
### `get_last_child`(*buffer, start\_line, level*)

Returns the line number of the last line after line number *start_line* whose
fold level is greater than *level* or the level of *start_line* if *level* is
`-1`.

Parameters:

* *`buffer`*: The global buffer.
* *`start_line`*: The line number in *buffer* of a header line.
* *`level`*: The fold level, or `-1` for the level of *start_line*.

- - -

<a id="get_lexer"></a>
### `get_lexer`(*buffer, current*)

Returns the name of the lexer used by the buffer, or the name of the lexer
under the caret in a multiple-language lexer if *current* is `true`.

Parameters:

* *`buffer`*: The global buffer.
* *`current`*: Whether or not to get the lexer at the current caret position
  in multi-language lexers. The default is `false` and returns the parent
  lexer.

- - -

<a id="get_line"></a>
### `get_line`(*buffer, line*)

Returns the text on line number *line*, including end of line characters, and
the length of the line.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to use.

Return:

* string, number

- - -

<a id="get_line_sel_end_position"></a>
### `get_line_sel_end_position`(*buffer, line*)

Returns the position of the end of the selected text on line number *line*,
or `-1`.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to use.

- - -

<a id="get_line_sel_start_position"></a>
### `get_line_sel_start_position`(*buffer, line*)

Returns the position of the beginning of the selected text on line number
*line*, or `-1`.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to use.

- - -

<a id="get_sel_text"></a>
### `get_sel_text`(*buffer*)

Returns the selected text and its length.
Multiple selections are included in order with no delimiters. Rectangular
selections are included from top to bottom with line ending delimiters.
Virtual space is not included.

Parameters:

* *`buffer`*: The global buffer.

Return:

* string, number

- - -

<a id="get_style_name"></a>
### `get_style_name`(*buffer, style\_num*)

Returns the name of style number *style_num*, in the range of `0` to `255`.

Parameters:

* *`buffer`*: The global buffer.
* *`style_num`*: The style number from `0` to `255` to get the name of.

See also:

* [`buffer.style_at`](buffer.html#style_at)

- - -

<a id="get_text"></a>
### `get_text`(*buffer*)

Returns all of the text in the buffer and its length.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="goto_line"></a>
### `goto_line`(*buffer, line*)

Places the caret an anchor at the beginning of line number *line* and scrolls
them into view.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to go to.

- - -

<a id="goto_pos"></a>
### `goto_pos`(*buffer, pos*)

Places the caret and anchor at position *pos* and scrolls them into view.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position in *buffer* to go to.

- - -

<a id="grab_focus"></a>
### `grab_focus`(*buffer*)

Sets the focus to the buffer's view.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="hide_lines"></a>
### `hide_lines`(*buffer, start\_line, end\_line*)

Hides the range of lines from line number *start_line* to *end_line*.
This has no effect on fold levels or fold flags and the first line cannot be
hidden.

Parameters:

* *`buffer`*: The global buffer.
* *`start_line`*: The start line of the range of lines in *buffer* to hide.
* *`end_line`*: The end line of the range of lines in *buffer* to hide.

- - -

<a id="hide_selection"></a>
### `hide_selection`(*buffer, normal*)

Do not highlight selected text if *normal* is `true`.

Parameters:

* *`buffer`*: The global buffer.
* *`normal`*: Whether or not to draw the normal selection.

- - -

<a id="home"></a>
### `home`(*buffer*)

Moves the caret to the beginning of the current line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="home_display"></a>
### `home_display`(*buffer*)

Moves the caret to the beginning of the current wrapped line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="home_display_extend"></a>
### `home_display_extend`(*buffer*)

Moves the caret to the beginning of the current wrapped line, extending the
selected text to the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="home_extend"></a>
### `home_extend`(*buffer*)

Moves the caret to the beginning of the current line, extending the selected
text to the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="home_rect_extend"></a>
### `home_rect_extend`(*buffer*)

Moves the caret to beginning of the current line, extending the rectangular
selection to the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="home_wrap"></a>
### `home_wrap`(*buffer*)

Moves the caret to beginning of the current wrapped line, or if already
there, to the beginning of the actual line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="home_wrap_extend"></a>
### `home_wrap_extend`(*buffer*)

Like `buffer:home_wrap()`, but extends the selected text to the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="indicator_all_on_for"></a>
### `indicator_all_on_for`(*buffer, pos*)

Returns a bit-mask representing which indicators are on at position *pos*.
Bit 0 is set if indicator 0 is on, bit 1 for indicator 1, etc.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position in *buffer* to get indicators at.

Return:

* number

- - -

<a id="indicator_clear_range"></a>
### `indicator_clear_range`(*buffer, pos, clear\_length*)

Clears indicator `buffer.indicator_current` over the range of text from *pos*
to *pos* + *clear_length*.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The start position of the range of text in *buffer* to clear
  indicators over.
* *`clear_length`*: The number of characters in the range of text to clear
  indicators over.

- - -

<a id="indicator_end"></a>
### `indicator_end`(*buffer, indicator, pos*)

Returns the end position of indicator number *indicator*, in the range of `0`
to `31`, at position *pos*.

Parameters:

* *`buffer`*: The global buffer.
* *`indicator`*: An indicator number in the range of `0` to `31`.
* *`pos`*: The position in *buffer* of the indicator.

- - -

<a id="indicator_fill_range"></a>
### `indicator_fill_range`(*buffer, pos, fill\_length*)

Sets indicator `buffer.indicator_value` or `buffer.indicator_current` over
the range of text from *pos* to *pos* + *fill_length*.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The start position of the range of text in *buffer* to set
  indicators over.
* *`fill_length`*: The number of characters in the range of text to set
  indicators over.

- - -

<a id="indicator_start"></a>
### `indicator_start`(*buffer, indicator, pos*)

Returns the position of the beginning of indicator number *indicator*, in the
range of `0` to `31`, at position *pos*.

Parameters:

* *`buffer`*: The global buffer.
* *`indicator`*: An indicator number in the range of `0` to `31`.
* *`pos`*: The position in *buffer* of the indicator.

- - -

<a id="indicator_value_at"></a>
### `indicator_value_at`(*buffer, indicator, pos*)

Returns the value of indicator number *indicator*, in the range of `0` to
`31`, at position *pos*.

Parameters:

* *`buffer`*: The global buffer.
* *`indicator`*: The indicator number in the range of `0` to `31`.
* *`pos`*: The position in *buffer* of the indicator.

Return:

* number

- - -

<a id="insert_text"></a>
### `insert_text`(*buffer, pos, text*)

Inserts string *text* at position *pos* or the caret if *pos* is `-1`.
If the caret is after the *pos*, it is moved appropriately, but not scrolled
into view.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position in *buffer* to insert text at, or `-1` for the
  current position.
* *`text`*: The text to insert.

- - -

<a id="line_copy"></a>
### `line_copy`(*buffer*)

Copies the current line to the clipboard.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_cut"></a>
### `line_cut`(*buffer*)

Cuts the current line to the clipboard.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_delete"></a>
### `line_delete`(*buffer*)

Deletes the current line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_down"></a>
### `line_down`(*buffer*)

Moves the caret down one line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_down_extend"></a>
### `line_down_extend`(*buffer*)

Moves the caret down one line, extending the selected text to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_down_rect_extend"></a>
### `line_down_rect_extend`(*buffer*)

Moves the caret down one line, extending the rectangular selection to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_duplicate"></a>
### `line_duplicate`(*buffer*)

Duplicates the current line below the line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_end"></a>
### `line_end`(*buffer*)

Moves the caret to the end of the current line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_end_display"></a>
### `line_end_display`(*buffer*)

Moves the caret to the end of the current wrapped line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_end_display_extend"></a>
### `line_end_display_extend`(*buffer*)

Moves the caret to the end of the current wrapped line, extending the
selected text to the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_end_extend"></a>
### `line_end_extend`(*buffer*)

Moves the caret to the end of the current line, extending the selected text
to the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_end_rect_extend"></a>
### `line_end_rect_extend`(*buffer*)

Moves the caret to the end of the current line, extending the rectangular
selection to the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_end_wrap"></a>
### `line_end_wrap`(*buffer*)

Moves the caret to the end of the current wrapped line, or if already there,
to the end of the actual line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_end_wrap_extend"></a>
### `line_end_wrap_extend`(*buffer*)

Like `buffer:line_end_wrap()`, but extends the selected text to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_from_position"></a>
### `line_from_position`(*buffer, pos*)

Returns the line number containing position *pos*.
Returns `0` if *pos* is less than 0 or `buffer.line_count` if *pos* is
greater than `buffer.length`.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position in *buffer* to get the line number of.

Return:

* number

- - -

<a id="line_length"></a>
### `line_length`(*buffer, line*)

Returns the number of characters on line number *line*, including end of line
characters.
To get line length excluding end of line characters, use
`buffer.line_end_position[line] - buffer:position_from_line(line)`.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to get the length of.

Return:

* number

- - -

<a id="line_scroll"></a>
### `line_scroll`(*buffer, columns, lines*)

Scroll right *columns* columns and down *lines* lines.
Negative values are allowed.

Parameters:

* *`buffer`*: The global buffer.
* *`columns`*: The number of columns to scroll horizontally.
* *`lines`*: The number of lines to scroll vertically.

- - -

<a id="line_scroll_down"></a>
### `line_scroll_down`(*buffer*)

Scroll the buffer down one line, keeping the caret visible.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_scroll_up"></a>
### `line_scroll_up`(*buffer*)

Scroll the buffer up one line, keeping the caret visible.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_transpose"></a>
### `line_transpose`(*buffer*)

Switch the current line with the previous one.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_up"></a>
### `line_up`(*buffer*)

Moves the caret up one line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_up_extend"></a>
### `line_up_extend`(*buffer*)

Moves the caret up one line, extending the selected text to the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="line_up_rect_extend"></a>
### `line_up_rect_extend`(*buffer*)

Moves the caret up one line, extending the rectangular selection to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="lines_join"></a>
### `lines_join`(*buffer*)

Joins the lines in the target range, inserting spaces in-between joined
words.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="lines_split"></a>
### `lines_split`(*buffer, pixel\_width*)

Splits the lines in the target range into lines of width at most
*pixel_width* or the width of the view if *pixel_width* is `0`.

Parameters:

* *`buffer`*: The global buffer.
* *`pixel_width`*: The pixel width to split lines at. When `0`, uses the
  width of the view.

- - -

<a id="lower_case"></a>
### `lower_case`(*buffer*)

Converts the selected text to lower case letters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="margin_text_clear_all"></a>
### `margin_text_clear_all`(*buffer*)

Clears margin text on all lines.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="marker_add"></a>
### `marker_add`(*buffer, line, marker\_num*)

Adds marker number *marker_num*, in the range of `0` to `31`, on line number
*line*, returning a marker handle which can be used in
`buffer:marker_delete_handle()` and `buffer:marker_line_from_handle()`, or
`-1` if the marker cannot be added.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number to add the marker on.
* *`marker_num`*: The marker number in the range of `0` to `31` to add.

Return:

* number

- - -

<a id="marker_add_set"></a>
### `marker_add_set`(*buffer, line, marker\_mask*)

Adds the markers specified in the marker bit-mask *marker_mask* to line
number *line*.
Bit 0 is set to add marker 0, bit 1 for marker 1, etc., up to marker 31.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number to add the markers on.
* *`marker_mask`*: The mask of markers to set. Set bit 0 to set marker 0, bit
  1 for marker 1 and so on.

- - -

<a id="marker_define"></a>
### `marker_define`(*buffer, marker\_num, marker\_symbol*)

Sets the symbol *marker_symbol* shown in the margin for marker number
*marker_num*, in the range of `0` to `31`.

Parameters:

* *`buffer`*: The global buffer.
* *`marker_num`*: The marker number in the range of `0` to `31` to set
  *marker_symbol* for.
* *`marker_symbol`*: The marker symbol: `_SCINTILLA.constants.SC_MARK_*`.

See also:

* [`_SCINTILLA.next_marker_number`](_SCINTILLA.html#next_marker_number)

- - -

<a id="marker_define_pixmap"></a>
### `marker_define_pixmap`(*buffer, marker\_num, pixmap*)

Defines XPM image *pixmap* for marker number *marker_num*, in the range of
`0` to `31`.
Pixmap markers use the `_SCINTILLA.constants.SC_MARK_PIXMAP` marker symbol.

Parameters:

* *`buffer`*: The global buffer.
* *`marker_num`*: The marker number in the range of `0` to `31` to define
  pixmap *pixmap* for.
* *`pixmap`*: The string pixmap data.

- - -

<a id="marker_define_rgba_image"></a>
### `marker_define_rgba_image`(*buffer, marker\_num, pixels*)

Defines RGBA image *pixels* for marker number *marker_num*, in the range of
`0` to `31`.
RGBA image markers use the `_SCINTILLA.constants.SC_MARK_RGBAIMAGE` marker
symbol. The dimensions for *pixels*, `buffer.rgba_image_width` and
`buffer.rgba_image_height`, must be already defined. *pixels* is a sequence
of 4 byte pixel values (red, blue, green, and alpha) defining the image line
by line starting at the top-left pixel.

Parameters:

* *`buffer`*: The global buffer.
* *`marker_num`*: The marker number in the range of `0` to `31` to define
  RGBA data *pixels* for.
* *`pixels`*: The string sequence of 4 byte pixel values starting with the
  pixels for the top line, with the leftmost pixel first, then continuing
  with the pixels for subsequent lines. There is no gap between lines for
  alignment reasons. Each pixel consists of, in order, a red byte, a green
  byte, a blue byte and an alpha byte. The colour bytes are not premultiplied
  by the alpha value. That is, a fully red pixel that is 25% opaque will be
  `[FF, 00, 00, 3F]`.

- - -

<a id="marker_delete"></a>
### `marker_delete`(*buffer, line, marker\_num*)

Deletes marker number *marker_num*, in the range of `0` to `31` or `-1` for
all markers, from line number *line*.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number to delete the marker on.
* *`marker_num`*: The marker number in the range of `0` to `31` to delete
  from *line*, or `-1` to delete all markers from the line.

- - -

<a id="marker_delete_all"></a>
### `marker_delete_all`(*buffer, marker\_num*)

Deletes marker number *marker_num*, in the range of `0` to `31` or `-1` for
all markers, from all lines in the buffer.

Parameters:

* *`buffer`*: The global buffer.
* *`marker_num`*: The marker number in the range of `0` to `31` to delete
  from all lines, or `-1` to delete all markers from all lines.

- - -

<a id="marker_delete_handle"></a>
### `marker_delete_handle`(*buffer, handle*)

Deletes the marker with handle *handle* returned by `buffer:marker_add()`.

Parameters:

* *`buffer`*: The global buffer.
* *`handle`*: The identifier of a marker returned by `buffer:marker_add()`.

- - -

<a id="marker_enable_highlight"></a>
### `marker_enable_highlight`(*buffer, enabled*)

Highlights the margin fold markers for the current fold block if *enabled* is
`true`.

Parameters:

* *`buffer`*: The global buffer.
* *`enabled`*: Whether or not to enable highlight.

- - -

<a id="marker_get"></a>
### `marker_get`(*buffer, line*)

Returns a bit-mask representing which markers are set line number *line*.
Bit 0 is set if marker 0 is set, bit 1 for marker 1, etc.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number to get markers on.

Return:

* number.

- - -

<a id="marker_line_from_handle"></a>
### `marker_line_from_handle`(*buffer, handle*)

Returns the line number the marker with handle *handle*, returned by
`buffer:marker_add()`, is on, or `-1`.

Parameters:

* *`buffer`*: The global buffer.
* *`handle`*: The identifier of a marker returned by `buffer:marker_add()`.

Return:

* number

- - -

<a id="marker_next"></a>
### `marker_next`(*buffer, start\_line, marker\_mask*)

Returns the first line number starting at line number *start_line* that has
all of the markers represented by marker bit-mask *marker_mask* set on, or
`-1`.
Bit 0 is set if marker 0 is set, bit 1 for marker 1, etc., up to marker 31.

Parameters:

* *`buffer`*: The global buffer.
* *`start_line`*: The start line to search from.
* *`marker_mask`*: The mask of markers to find. Set bit 0 to find marker 0,
  bit 1 for marker 1 and so on.

Return:

* number

- - -

<a id="marker_previous"></a>
### `marker_previous`(*buffer, start\_line, marker\_mask*)

Returns the last line number before or on line number *start_line* that has
all of the markers represented by marker bit-mask *marker_mask* set on, or
`-1`.
Bit 0 is set if marker 0 is set, bit 1 for marker 1, etc., up to marker 31.

Parameters:

* *`buffer`*: The global buffer.
* *`start_line`*: The start line to search from.
* *`marker_mask`*: The mask of markers to find. Set bit 0 to find marker 0,
  bit 1 for marker 1 and so on.

Return:

* number

- - -

<a id="marker_symbol_defined"></a>
### `marker_symbol_defined`(*buffer, marker\_num*)

Returns the symbol defined for marker number *marker_num*, in the range of
`0` to `31`, used in `buffer:marker_define()`,
`buffer:marker_define_pixmap()`, or `buffer:marker_define_rgba_image()`.

Parameters:

* *`buffer`*: The global buffer.
* *`marker_num`*: The marker number in the range of `0` to `31` to get the
  symbol of.

Return:

* number

- - -

<a id="move_caret_inside_view"></a>
### `move_caret_inside_view`(*buffer*)

Moves the caret to be visible inside the view if it is not already, removing
any selections.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="move_selected_lines_down"></a>
### `move_selected_lines_down`(*buffer*)

Moves the selected lines down one line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="move_selected_lines_up"></a>
### `move_selected_lines_up`(*buffer*)

Moves the selected lines up one line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="new"></a>
### `new`()

Creates and returns a new buffer.
Emits a `BUFFER_NEW` event.

Return:

* the new buffer.

See also:

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

- - -

<a id="new_line"></a>
### `new_line`(*buffer*)

Inserts a new line character(s) at the caret depending on the end of line
mode.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="page_down"></a>
### `page_down`(*buffer*)

Moves the caret one page down.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="page_down_extend"></a>
### `page_down_extend`(*buffer*)

Moves the caret one page down, extending the selected text to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="page_down_rect_extend"></a>
### `page_down_rect_extend`(*buffer*)

Moves the caret one page down, extending the rectangular selection to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="page_up"></a>
### `page_up`(*buffer*)

Moves the caret one page up.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="page_up_extend"></a>
### `page_up_extend`(*buffer*)

Moves the caret one page up, extending the selected text to the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="page_up_rect_extend"></a>
### `page_up_rect_extend`(*buffer*)

Moves the caret one page up, extending the rectangular selection to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="para_down"></a>
### `para_down`(*buffer*)

Moves the caret one paragraph down.
Paragraphs are surrounded by one or more blank lines.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="para_down_extend"></a>
### `para_down_extend`(*buffer*)

Moves the caret one paragraph down, extending the selected text to the new
position.
Paragraphs are surrounded by one or more blank lines.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="para_up"></a>
### `para_up`(*buffer*)

Moves the caret one paragraph up.
Paragraphs are surrounded by one or more blank lines.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="para_up_extend"></a>
### `para_up_extend`(*buffer*)

Moves the caret one paragraph up, extending the selected text to the new
position.
Paragraphs are surrounded by one or more blank lines.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="paste"></a>
### `paste`(*buffer*)

Pastes the contents of the clipboard into the buffer, replacing the selected
text depending on `buffer.multi_paste`.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="point_x_from_position"></a>
### `point_x_from_position`(*buffer, pos*)

Returns the x-coordinate in the view of position *pos*.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position in *buffer* to get the x-coordinate in the view of.

Return:

* number

- - -

<a id="point_y_from_position"></a>
### `point_y_from_position`(*buffer, pos*)

Returns the y-coordinate in the view of position *pos*.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position in *buffer* to get the y-coordinate in the view of.

Return:

* number

- - -

<a id="position_after"></a>
### `position_after`(*buffer, pos*)

Returns the position of the next character after position *pos*, taking code
page into account, or `buffer.length - 1`.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position in *buffer* to get the position after from.

- - -

<a id="position_before"></a>
### `position_before`(*buffer, pos*)

Returns the position of the previous character before position *pos*, taking
code page into account, or `0`.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position in *buffer* to get the position before from.

Return:

* number

- - -

<a id="position_from_line"></a>
### `position_from_line`(*buffer, line*)

Returns the position at the beginning of line number *line*.
Returns `-1` if *line* is greater than `buffer.line_count`.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to get the beginning position for.

Return:

* number

- - -

<a id="position_from_point"></a>
### `position_from_point`(*buffer, x, y*)

Returns the position closest to view coordinates *x* and *y*, which may be
in-between multi-byte characters.

Parameters:

* *`buffer`*: The global buffer.
* *`x`*: The x-coordinate in the view to use.
* *`y`*: The y-coordinate in the view to use.

Return:

* number

- - -

<a id="position_from_point_close"></a>
### `position_from_point_close`(*buffer, x, y*)

Returns the position closest to view coordinates *x* and *y*, which may be
in-between multi-byte characters, or `-1` if the point is outside the window
or not close to any text.

Parameters:

* *`buffer`*: The global buffer.
* *`x`*: The x-coordinate in the view to use.
* *`y`*: The y-coordinate in the view to use.

Return:

* number

- - -

<a id="redo"></a>
### `redo`(*buffer*)

Redoes the next undone action.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="register_image"></a>
### `register_image`(*buffer, type, xpm\_data*)

Registers XPM image *xpm_data* to type number *type* for use in
autocompletion lists.

Parameters:

* *`buffer`*: The global buffer.
* *`type`*: Integer type to register the image with.
* *`xpm_data`*: The XPM data as described in `buffer:marker_define_pixmap()`.

- - -

<a id="register_rgba_image"></a>
### `register_rgba_image`(*buffer, type, pixels*)

Registers RGBA image *pixels* to type number *type* for use in autocompletion
lists.
The dimensions for *pixels*, `buffer.rgba_image_width` and
`buffer.rgba_image_height`, must be already defined. *pixels* is a sequence
of 4 byte pixel values (red, blue, green, and alpha) defining the image line
by line starting at the top-left pixel.

Parameters:

* *`buffer`*: The global buffer.
* *`type`*: Integer type to register the image with.
* *`pixels`*: The RGBA data as described in
  `buffer:marker_define_rgba_image()`.

- - -

<a id="reload"></a>
### `reload`(*buffer*)

Reloads the file in the buffer.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="replace_sel"></a>
### `replace_sel`(*buffer, text*)

Replaces the selected text with string *text*, scrolling the caret into view.

Parameters:

* *`buffer`*: The global buffer.
* *`text`*: The text to replace the selected text with.

- - -

<a id="replace_target"></a>
### `replace_target`(*buffer, text*)

Replaces the text in the target range with string *text*, returning the
length of *text*.
The recommended way to delete text in the buffer is to set the target to the
text to be removed, and to call this function with an empty string.

Parameters:

* *`buffer`*: The global buffer.
* *`text`*: The text to replace the target range with.

Return:

* number

- - -

<a id="replace_target_re"></a>
### `replace_target_re`(*buffer, text*)

Replaces the text in the target range with string *text* after replacing any
"\d" sequences, where `d` is a number in the range of `1` to `9`, with the
tag match values from the regular expression or the entire match for "\0",
returning the length of the replacement text.

Parameters:

* *`buffer`*: The global buffer.
* *`text`*: The text to replace the target range with.

Return:

* number

- - -

<a id="rotate_selection"></a>
### `rotate_selection`(*buffer*)

Sets the next additional selection to be the main selection.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="save"></a>
### `save`(*buffer*)

Saves the buffer to the file.
Emits `FILE_BEFORE_SAVE` and `FILE_AFTER_SAVE` events.

Parameters:

* *`buffer`*: The global buffer.

See also:

* [`events`](events.html)

- - -

<a id="save_as"></a>
### `save_as`(*buffer, utf8\_filename*)

Saves the buffer to the *utf8_filename* or user-specified filename.
Emits a `FILE_SAVED_AS` event.

Parameters:

* *`buffer`*: The global buffer.
* *`utf8_filename`*: The new filepath to save the buffer to. Must be UTF-8
  encoded.

See also:

* [`events`](events.html)

- - -

<a id="scroll_caret"></a>
### `scroll_caret`(*buffer*)

Scrolls the caret into view based on the policies set with
`buffer:set_x_caret_policy()` and `buffer:set_y_caret_policy()`.

Parameters:

* *`buffer`*: The global buffer.

See also:

* [`set_x_caret_policy`](#set_x_caret_policy)
* [`set_y_caret_policy`](#set_y_caret_policy)

- - -

<a id="scroll_range"></a>
### `scroll_range`(*buffer, secondary\_pos, primary\_pos*)

Scrolls the range between *primary_pos* and *secondary_pos* into view, with
priority given to *primary_pos*.
Similar to `buffer:scroll_caret()`, but with *primary_pos* instead of
`buffer.current_pos`.
This is useful for scrolling search results into view.

Parameters:

* *`buffer`*: The global buffer.
* *`secondary_pos`*: The secondary range position to scroll into view.
* *`primary_pos`*: The primary range position to scroll into view.

- - -

<a id="scroll_to_end"></a>
### `scroll_to_end`(*buffer*)

Scrolls to the end of the buffer without moving the caret.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="scroll_to_start"></a>
### `scroll_to_start`(*buffer*)

Scrolls to the beginning of the buffer without moving the caret.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="search_anchor"></a>
### `search_anchor`(*buffer*)

Sets the current position to anchor subsequent searches with
`buffer:search_next()` and `buffer:search_prev()`.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="search_in_target"></a>
### `search_in_target`(*buffer, text*)

Searches for the first occurrence of string *text* in the target range
bounded by `buffer.target_start` and `buffer.target_end` using search flags
`buffer.search_flags` and, if found, sets the new target range to that
occurrence, returning its position or `-1` otherwise.

Parameters:

* *`buffer`*: The global buffer.
* *`text`*: The text to search the target range for.

Return:

* number

See also:

* [`search_flags`](#search_flags)

- - -

<a id="search_next"></a>
### `search_next`(*buffer, flags, text*)

Searches for and selects the first occurrence of string *text* starting at
the search anchor using search flags *flags*, returning the position of the
occurrence or `-1`.
Selected text is not scrolled into view.

Parameters:

* *`buffer`*: The global buffer.
* *`flags`*: The search flags to use. See `buffer.search_flags`.
* *`text`*: The text to search for.

Return:

* number

See also:

* [`search_flags`](#search_flags)

- - -

<a id="search_prev"></a>
### `search_prev`(*buffer, flags, text*)

Searches for and selects the last occurrence of string *text* before the
search anchor using search flags *flags*, returning the position of the
occurrence or `-1`.

Parameters:

* *`buffer`*: The global buffer.
* *`flags`*: The search flags to use. See `buffer.search_flags`.
* *`text`*: The text to search for.

Return:

* number

See also:

* [`search_flags`](#search_flags)

- - -

<a id="select_all"></a>
### `select_all`(*buffer*)

Selects all of the text in the buffer without scrolling the view.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="selection_duplicate"></a>
### `selection_duplicate`(*buffer*)

Duplicates the selected text or the current line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="set_chars_default"></a>
### `set_chars_default`(*buffer*)

Resets the set of whitespace and word characters to their default characters.

Parameters:

* *`buffer`*: The global buffer.

See also:

* [`whitespace_chars`](#whitespace_chars)
* [`word_chars`](#word_chars)

- - -

<a id="set_empty_selection"></a>
### `set_empty_selection`(*buffer, pos*)

Sets the current position to position *pos* without scrolling the view,
removing any selections.

Parameters:

* *`buffer`*: The buffer
* *`pos`*: The position in *buffer* to move to.

- - -

<a id="set_encoding"></a>
### `set_encoding`(*buffer, encoding*)

Sets the encoding for the buffer to *encoding*, converting its contents from
the old encoding to the new one.

Parameters:

* *`buffer`*: The global buffer.
* *`encoding`*: The string encoding to set. Valid encodings are ones that GNU
  iconv accepts.

Usage:

* `buffer.set_encoding(buffer, 'ASCII')`

- - -

<a id="set_fold_margin_colour"></a>
### `set_fold_margin_colour`(*buffer, use\_setting, color*)

Overrides the default color of the fold margin with *color*, in "0xBBGGRR"
format, if *use_setting* is `true`.

Parameters:

* *`buffer`*: The global buffer.
* *`use_setting`*: Whether or not to use *color*.
* *`color`*: The color in "0xBBGGRR" format.

- - -

<a id="set_fold_margin_hi_colour"></a>
### `set_fold_margin_hi_colour`(*buffer, use\_setting, color*)

Overrides the default highlight color of the fold margin with *color*, in
"0xBBGGRR" format, if *use_setting* is `true`.

Parameters:

* *`buffer`*: The global buffer.
* *`use_setting`*: Whether or not to use *color*.
* *`color`*: The color in "0xBBGGRR" format.

- - -

<a id="set_hotspot_active_back"></a>
### `set_hotspot_active_back`(*buffer, use\_setting, color*)

Overrides the default background color of active hotspots with *color*, in
"0xBBGGRR" format, if *use_setting* is `true`.

Parameters:

* *`buffer`*: The global buffer.
* *`use_setting`*: Whether or not to use *color*.
* *`color`*: The color in "0xBBGGRR" format.

- - -

<a id="set_hotspot_active_fore"></a>
### `set_hotspot_active_fore`(*buffer, use\_setting, color*)

Overrides the default foreground color of active hotspots with *color*, in
"0xBBGGRR" format, if *use_setting* is `true`.

Parameters:

* *`buffer`*: The global buffer.
* *`use_setting`*: Whether or not to use *color*.
* *`color`*: The color in "0xBBGGRR" format.

- - -

<a id="set_length_for_encode"></a>
### `set_length_for_encode`(*buffer, bytes*)

Sets the length of *string* in `buffer:encoded_from_utf8()` to *bytes*.

Parameters:

* *`buffer`*: The global buffer.
* *`bytes`*: The number of bytes to encode, or `-1` for measuring to first
  null byte.

- - -

<a id="set_lexer"></a>
### `set_lexer`(*buffer, lang*)

Sets the name of the lexer used by the buffer to *lang* or the auto-detected
language and then loads the appropriate language-specific module if the
module exists.

Parameters:

* *`buffer`*: The global buffer.
* *`lang`*: Optional string language name to set. If `nil`, attempts to
  auto-detect the buffer's language.

Usage:

* `buffer.set_lexer(buffer, 'language_name')`

- - -

<a id="set_save_point"></a>
### `set_save_point`(*buffer*)

Tells Scintilla the buffer has no unsaved changes.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="set_sel"></a>
### `set_sel`(*buffer, start\_pos, end\_pos*)

Selects the range of text from *start_pos* to *end_pos* in the buffer,
scrolling the selected text into view.

Parameters:

* *`buffer`*: The global buffer.
* *`start_pos`*: The start position of the range of text in *buffer* to
  select. If negative, it means the end of the buffer.
* *`end_pos`*: The end position of the range of text in *buffer* to select.
  If negative, it means remove any selection (i.e. set the `anchor` to the
  same position as `current_pos`).

- - -

<a id="set_sel_back"></a>
### `set_sel_back`(*buffer, use\_setting, color*)

Overrides the default background color of all selected text with *color*, in
"0xBBGGRR" format, if *use_setting* is `true`.

Parameters:

* *`buffer`*: The global buffer.
* *`use_setting`*: Whether or not to use *color*.
* *`color`*: The color in "0xBBGGRR" format.

- - -

<a id="set_sel_fore"></a>
### `set_sel_fore`(*buffer, use\_setting, color*)

Overrides the default foreground color of all selected text with *color*, in
"0xBBGGRR" format, if *use_setting* is `true`.

Parameters:

* *`buffer`*: The global buffer.
* *`use_setting`*: Whether or not to use *color*.
* *`color`*: The color in "0xBBGGRR" format.

- - -

<a id="set_selection"></a>
### `set_selection`(*buffer, caret, anchor*)

Selects the range of text from *anchor* to *caret* in the buffer, removing
all other selections.

Parameters:

* *`buffer`*: The global buffer.
* *`caret`*: The caret position of the range of text to select in *buffer*.
* *`anchor`*: The anchor position of the range of text to select in *buffer*.

- - -

<a id="set_styling"></a>
### `set_styling`(*buffer, length, style*)

Sets the style of the next *length* characters, from the current styling
position, to style number *style*, in the range from `0` to `255`, and
increments the styling position by *length*.

Parameters:

* *`buffer`*: The global buffer.
* *`length`*: The number of characters to style.
* *`style`*: The style number to set.

- - -

<a id="set_text"></a>
### `set_text`(*buffer, text*)

Replaces all of the text in the buffer with string *text*.

Parameters:

* *`buffer`*: The global buffer.
* *`text`*: The text to set.

- - -

<a id="set_visible_policy"></a>
### `set_visible_policy`(*buffer, visible\_policy, visible\_slop*)

Sets the visible policy bit-mask *visible_policy* for displaying lines using
`buffer:ensure_visible_enforce_policy()` to *visible_slop* number of lines
from the bottom of the view.
It is similar in operation to `buffer:set_y_caret_policy()`.

Parameters:

* *`buffer`*: The global buffer.
* *`visible_policy`*: The combination of `_SCINTILLA.constants.VISIBLE_SLOP`
  (0x01) and `_SCINTILLA.constants.VISIBLE_STRICT` (0x04) policy flags to set.
* *`visible_slop`*: The slop value to use.

- - -

<a id="set_whitespace_back"></a>
### `set_whitespace_back`(*buffer, use\_setting, color*)

Overrides the background color of whitespace with *color*, in "0xBBGGRR"
format, if *use_setting* is `true`.

Parameters:

* *`buffer`*: The global buffer.
* *`use_setting`*: Whether or not to use *color*.
* *`color`*: The color in "0xBBGGRR" format.

- - -

<a id="set_whitespace_fore"></a>
### `set_whitespace_fore`(*buffer, use\_setting, color*)

Overrides the foreground color of whitespace with *color*, in "0xBBGGRR"
format, if *use_setting* is `true`.

Parameters:

* *`buffer`*: 
* *`use_setting`*: Whether or not to use *color*.
* *`color`*: The color in "0xBBGGRR" format.

- - -

<a id="set_x_caret_policy"></a>
### `set_x_caret_policy`(*buffer, caret\_policy, caret\_slop*)

Set the way the caret is kept visible when going sideways.
The exclusion zone is given in pixels.

Parameters:

* *`buffer`*: The global buffer.
* *`caret_policy`*: The combination of `_SCINTILLA.constants.CARET_SLOP`
  (0x01), `_SCINTILLA.constants.CARET_STRICT` (0x04),
  `_SCINTILLA.constants.CARET_EVEN` (0x08), and
  `_SCINTILLA.constants.CARET_JUMPS` (0x10) policy flags to set.
* *`caret_slop`*: The slop value to use.

- - -

<a id="set_y_caret_policy"></a>
### `set_y_caret_policy`(*buffer, caret\_policy, caret\_slop*)

Set the way the line the caret is on is kept visible.

Parameters:

* *`buffer`*: The global buffer.
* *`caret_policy`*: The combination of `_SCINTILLA.constants.CARET_SLOP`
  (0x01), `_SCINTILLA.constants.CARET_STRICT` (0x04),
  `_SCINTILLA.constants.CARET_EVEN` (0x08), and
  `_SCINTILLA.constants.CARET_JUMPS` (0x10) policy flags to set.
* *`caret_slop`*: The slop value to use.

- - -

<a id="show_lines"></a>
### `show_lines`(*buffer, start\_line, end\_line*)

Shows the range of lines from line number *start_line* to *end_line*.
This has no effect on fold levels or fold flags and the first line cannot be
hidden.

Parameters:

* *`buffer`*: The global buffer.
* *`start_line`*: The start line of the range of lines in *buffer* to show.
* *`end_line`*: The end line of the range of lines in *buffer* to show.

- - -

<a id="start_styling"></a>
### `start_styling`(*buffer, position, mask*)

Begin styling at position *position* with the 8-bit styling bit-mask *mask*
that determines which style bits can be set with `buffer:set_styling()`.

Parameters:

* *`buffer`*: The global buffer.
* *`position`*: The position in *buffer* to start styling at.
* *`mask`*: The bit mask of style bits that can be set when styling.

Usage:

* `buffer:start_styling(0, 0xFF)`

- - -

<a id="stuttered_page_down"></a>
### `stuttered_page_down`(*buffer*)

Moves the caret to the bottom of the page, or if already there, one page
down.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="stuttered_page_down_extend"></a>
### `stuttered_page_down_extend`(*buffer*)

Like `buffer:stuttered_page_down()`, but extends the selected text to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="stuttered_page_up"></a>
### `stuttered_page_up`(*buffer*)

Moves the caret to the top of the page, or if already there, one page up.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="stuttered_page_up_extend"></a>
### `stuttered_page_up_extend`(*buffer*)

Like `buffer:stuttered_page_up()`, but extends the selected text to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="style_clear_all"></a>
### `style_clear_all`(*buffer*)

Sets all styles to have the same properties as
`_SCINTILLA.constants.STYLE_DEFAULT`.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="style_reset_default"></a>
### `style_reset_default`(*buffer*)

Resets `_SCINTILLA.constants.STYLE_DEFAULT` to its initial state.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="swap_main_anchor_caret"></a>
### `swap_main_anchor_caret`(*buffer*)

Swaps the anchor and caret positions of the main selection.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="tab"></a>
### `tab`(*buffer*)

Indents the selected lines, replaces the selected text on a line with a Tab
character ("\t"), or inserts a Tab character at the caret.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="target_as_utf8"></a>
### `target_as_utf8`(*buffer*)

Returns the result of the text in the target range converted from the
buffer's code page into UTF-8.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="target_from_selection"></a>
### `target_from_selection`(*buffer*)

Sets the beginning and end positions of the target range to be the beginning
and end positions of the main selection.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="text_height"></a>
### `text_height`(*buffer, line*)

Returns the height in pixels of line number *line*.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to get the pixel height of.

Return:

* number

- - -

<a id="text_range"></a>
### `text_range`(*buffer, start\_pos, end\_pos*)

Returns the range of text from *start_pos* to *end_pos* in the buffer.

Parameters:

* *`buffer`*: The global buffer.
* *`start_pos`*: The start position of the range of text to get in *buffer*.
* *`end_pos`*: The end position of the range of text to get in *buffer*.

- - -

<a id="text_width"></a>
### `text_width`(*buffer, style\_num, text*)

Returns the width in pixels of string *text* styled with style number
*style_num*, in the range of `0` to `255`.

Parameters:

* *`buffer`*: The global buffer.
* *`style_num`*: The style number between `0` and `255` to use.
* *`text`*: The text to measure the width of.

Return:

* number

- - -

<a id="toggle_caret_sticky"></a>
### `toggle_caret_sticky`(*buffer*)

Cycles between caret sticky option settings
`_SCINTILLA.constants.SC_CARETSTICKY_ON`,
`_SCINTILLA.constants.SC_CARETSTICKY_WHITESPACE`, and
`_SCINTILLA.constants.SC_CARETSTICKY_OFF`.

Parameters:

* *`buffer`*: The global buffer.

See also:

* [`caret_sticky`](#caret_sticky)

- - -

<a id="toggle_fold"></a>
### `toggle_fold`(*buffer, line*)

Toggles the fold state of a fold header line between expanded, where all
of its child lines are displayed, and contracted, where all of its child
lines are hidden.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to toggle the fold on.

- - -

<a id="undo"></a>
### `undo`(*buffer*)

Undoes the most recent action.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="upper_case"></a>
### `upper_case`(*buffer*)

Converts the selected text to upper case letters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="user_list_show"></a>
### `user_list_show`(*buffer, list\_type, item\_list*)

Displays a list from *item_list*, a sorted string whose items are delimited
by `buffer.auto_c_separator` characters, using the list identifier number
*list_type* which is greater than zero and sent in a `USER_LIST_SELECTION`
event after selecting an item.

Parameters:

* *`buffer`*: The global buffer.
* *`list_type`*: The list identifier number greater than zero to use.
* *`item_list`*: The sorted string of words to show, separated by
  `buffer.auto_c_separator` characters (initially spaces).

See also:

* [`_SCINTILLA.next_user_list_type`](_SCINTILLA.html#next_user_list_type)

- - -

<a id="vc_home"></a>
### `vc_home`(*buffer*)

Moves the caret to the first visible character on the current line, or if
already there, to the beginning of the current line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="vc_home_display"></a>
### `vc_home_display`(*buffer*)

Moves the caret to the first visible character on the current wrapped line,
or if already there, to the beginning of the current wrapped line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="vc_home_display_extend"></a>
### `vc_home_display_extend`(*buffer*)

Like `buffer:vc_home_display()`, but extends the selected text to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="vc_home_extend"></a>
### `vc_home_extend`(*buffer*)

Like `buffer:vc_home()`, but extends the selected text to the new position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="vc_home_rect_extend"></a>
### `vc_home_rect_extend`(*buffer*)

Like `buffer:vc_home()`, but extends the rectangular selection to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="vc_home_wrap"></a>
### `vc_home_wrap`(*buffer*)

Moves the caret to the first visible character on the wrapped line, or if
already there, to the beginning of the actual line.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="vc_home_wrap_extend"></a>
### `vc_home_wrap_extend`(*buffer*)

Like `buffer:vc_home_wrap()`, but extends the selected text to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="vertical_centre_caret"></a>
### `vertical_centre_caret`(*buffer*)

Centers current line in the view.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="visible_from_doc_line"></a>
### `visible_from_doc_line`(*buffer, line*)

Returns the displayed line number of actual line number *line*, taking hidden
lines into account, or `-1` if *line* is outside the range of lines in the
buffer.
Lines can occupy more than one display line if they wrap.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to use.

Return:

* number

- - -

<a id="word_end_position"></a>
### `word_end_position`(*buffer, pos, only\_word\_chars*)

Returns the position of the end of the word at position *pos*.
`buffer.word_chars` contains word characters. If *pos* has a non-word
character to its right and *only_word_chars* is `false`, returns the position
of the first word character.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position in *buffer* of the word.
* *`only_word_chars`*: If `true`, stops searching at the first non-word
  character in the search direction. Otherwise, the first character in the
  search direction sets the type of the search as word or non-word and the
  search stops at the first non-matching character. Searches are also
  terminated by the start or end of the buffer.

- - -

<a id="word_left"></a>
### `word_left`(*buffer*)

Moves the caret left one word.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="word_left_end"></a>
### `word_left_end`(*buffer*)

Moves the caret left one word, positioning the caret at the end of the
previous word.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="word_left_end_extend"></a>
### `word_left_end_extend`(*buffer*)

Like `buffer:word_left_end()`, but extends the selected text to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="word_left_extend"></a>
### `word_left_extend`(*buffer*)

Moves the caret left one word, extending the selected text to the new
position.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="word_part_left"></a>
### `word_part_left`(*buffer*)

Moves to the previous underscore or change in capitalization within the
current word.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="word_part_left_extend"></a>
### `word_part_left_extend`(*buffer*)

Moves to the previous underscore or change in capitalization within the
current word, extending the selected text to the new position.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="word_part_right"></a>
### `word_part_right`(*buffer*)

Moves to the next underscore or change in capitalization within the current
word.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="word_part_right_extend"></a>
### `word_part_right_extend`(*buffer*)

Moves to the next underscore or change in capitalization within the current
word, extending the selected text to the new position.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="word_right"></a>
### `word_right`(*buffer*)

Moves the caret right one word.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="word_right_end"></a>
### `word_right_end`(*buffer*)

Moves the caret right one word, positioning the cursor at the end of the
current word.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="word_right_end_extend"></a>
### `word_right_end_extend`(*buffer*)

Like `buffer:word_right_end()`, but extends the selected text to the new
position.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="word_right_extend"></a>
### `word_right_extend`(*buffer*)

Moves the caret right one word, extending the selected text to the new
position.
`buffer.word_chars` contains word characters.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="word_start_position"></a>
### `word_start_position`(*buffer, pos, only\_word\_chars*)

Returns the position of the beginning of the word at position *pos*.
`buffer.word_chars` contains word characters. If *pos* has a non-word
character to its left and *only_word_chars* is `false`, returns the position
of the last word character.

Parameters:

* *`buffer`*: The global buffer.
* *`pos`*: The position in *buffer* of the word.
* *`only_word_chars`*: If `true`, stops searching at the first non-word
  character in the search direction. Otherwise, the first character in the
  search direction sets the type of the search as word or non-word and the
  search stops at the first non-matching character. Searches are also
  terminated by the start or end of the buffer.

- - -

<a id="wrap_count"></a>
### `wrap_count`(*buffer, line*)

Returns the number of wrapped lines needed to display line number *line*.

Parameters:

* *`buffer`*: The global buffer.
* *`line`*: The line number in *buffer* to use.

Return:

* number

- - -

<a id="zoom_in"></a>
### `zoom_in`(*buffer*)

Increases the size of all fonts by one point, up to 20.

Parameters:

* *`buffer`*: The global buffer.

- - -

<a id="zoom_out"></a>
### `zoom_out`(*buffer*)

Decreases the size of all fonts by one point, down to -10.

Parameters:

* *`buffer`*: The global buffer.

- - -


