-- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE. -- This is a DUMMY FILE used for making LuaDoc for built-in functions in the -- global buffer table. --- -- A Textadept buffer object. -- In addition to these functions and fields, buffers also contain the constants -- within [`_SCINTILLA.constants`][], which are too numerous to list here. -- 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. -- -- [`_SCINTILLA.constants`]: _SCINTILLA.html#constants -- @field additional_caret_fore (number) -- The foreground color, in "0xBBGGRR" format, of additional carets. -- @field additional_carets_blink (bool) -- Allow additional carets to blink. -- The default value is `true`. -- @field additional_carets_visible (bool) -- Display additional carets. -- The default value is `true`. -- @field additional_sel_alpha (number) -- The alpha value, ranging from `0` (transparent) to `255` (opaque), of -- additional selections. -- The default value is `buffer.ALPHA_NOALPHA`, for no alpha. -- @field additional_sel_back (number, Write-only) -- The background color, in "0xBBGGRR" format, of additional selections. -- This field has no effect when calling `buffer:set_sel_back(false, ...)`. -- @field additional_sel_fore (number, Write-only) -- The foreground color, in "0xBBGGRR" format, of additional selections. -- This field has no effect when calling `buffer:set_sel_fore(false, ...)`. -- @field additional_selection_typing (bool) -- Type into multiple selections. -- The default value is `false`. -- @field all_lines_visible (bool, Read-only) -- Whether or not all lines are visible. -- @field anchor (number) -- The position of the anchor. -- @field annotation_lines (table, Read-only) -- Table of the number of annotation lines for line numbers starting from -- zero. -- @field 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. -- @field annotation_style_offset (number) -- The beginning of the range of style numbers used for annotations. -- Always set this to the result of -- [`buffer.allocate_extended_styles`](#allocate_extended_styles). -- Annotation styles may be completely separated from standard text styles by -- setting a style offset. For example, when set to `512`, annotation styles -- are 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`. -- @field annotation_text (table) -- Table of annotation text for line numbers starting from zero. -- @field annotation_visible (number) -- The annotation visibility mode. -- -- * `buffer.ANNOTATION_HIDDEN` -- Annotations are invisible. -- * `buffer.ANNOTATION_STANDARD` -- Draw annotations left-justified with no decoration. -- * `buffer.ANNOTATION_BOXED` -- Indent annotations to match the annotated text and outline them with a -- box. -- -- The default value is `buffer.ANNOTATION_HIDDEN`. -- @field auto_c_auto_hide (bool) -- Automatically hide the autocompletion or user list when no entries match -- typed text. -- The default value is `true`. -- @field auto_c_cancel_at_start (bool) -- Cancel an autocompletion or user list when backspacing to a position before -- where autocompletion started instead of before the word being completed. -- The default value is `true`. -- @field auto_c_case_insensitive_behaviour (number) -- The behavior mode for a case insensitive autocompletion or user list when -- [`buffer.auto_c_ignore_case`](#auto_c_ignore_case) is `true`. -- -- * `buffer.CASEINSENSITIVEBEHAVIOR_RESPECTCASE` -- Prefer to select case-sensitive matches. -- * `buffer.CASEINSENSITIVEBEHAVIOR_IGNORECASE` -- No preference. -- -- The default value is `buffer.CASEINSENSITIVEBEHAVIOR_RESPECTCASE`. -- @field auto_c_choose_single (bool) -- Automatically choose the item in a single-item autocompletion list. This -- option has no effect for a user list. -- The default value is `false`. -- @field auto_c_current (number, Read-only) -- The index of the currently selected item in the autocompletion list. -- @field auto_c_current_text (string, Read-only) -- The text of the currently selected item in the autocompletion list. -- @field auto_c_drop_rest_of_word (bool) -- Delete word characters after autocompleted text. -- The default value is `false`. -- @field auto_c_fill_ups (string, Write-only) -- The set of characters that choose the currently selected item in an -- autocompletion or user list when typed. -- The default value is an empty string. -- @field auto_c_ignore_case (bool) -- Ignore case when searching an autocompletion or user list for -- matches. -- The default value is `false`. -- @field auto_c_max_height (number) -- The maximum number of items per page to show in autocompletion and user -- lists. The default value is `5`. -- @field auto_c_max_width (number) -- The maximum number of characters per item to show in autocompletion and -- user lists. -- The default value is `0`, which automatically sizes the width to fit the -- longest item. -- @field auto_c_order (number) -- The order setting for autocompletion lists. -- -- * `buffer.ORDER_PRESORTED` -- Lists passed to [`buffer.auto_c_show`](#auto_c_show) are in sorted, -- alphabetical order. -- * `buffer.ORDER_PERFORMSORT` -- Sort autocompletion lists passed to [`buffer.auto_c_show`](#auto_c_show). -- * `buffer.ORDER_CUSTOM` -- Lists passed to [`buffer.auto_c_show`](#auto_c_show) are already in a -- custom order. -- -- The default value is `buffer.ORDER_PRESORTED`. -- @field auto_c_separator (number) -- The byte value of the character that separates autocompletion list items. -- The default value is `32` (' '). -- @field auto_c_type_separator (number) -- The character byte that separates autocompletion and 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 ('?'). -- @field back_space_un_indents (bool) -- Un-indent text when backspacing within indentation. -- The default value is `false`. -- @field 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`. -- @field call_tip_fore_hlt (number, Write-only) -- The foreground color, in "0xBBGGRR" format, of the highlighted part of -- call tips. -- @field call_tip_position (boolean) -- Display the call tip above instead of below the text. -- The default value is `false`. -- @field call_tip_use_style (number) -- The pixel size of tab characters in call tips. -- When non-zero, also enables the use of style number `buffer.STYLE_CALLTIP` -- instead of `buffer.STYLE_DEFAULT` for call tip styles. -- The default value is `0`. -- @field caret_fore (number) -- The foreground color, in "0xBBGGRR" format, of the caret. -- @field caret_line_back (number) -- The background color, in "0xBBGGRR" format, of the line containing the -- caret. -- @field caret_line_back_alpha (number) -- The background alpha value, ranging from `0` (transparent) to `255` -- (opaque), of the caret line. -- The default value is `buffer.ALPHA_NOALPHA`, for no alpha. -- @field caret_line_visible (bool) -- Color the background of the line containing the caret a different color. -- The default value is `false`. -- @field 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. -- @field caret_period (number) -- The time between caret blinks in milliseconds. -- A value of `0` stops blinking. -- The default value is `500`. -- @field caret_sticky (number) -- The preferred horizontal position of the caret when moving between lines. -- -- * `buffer.CARETSTICKY_OFF` -- Use the same position as on the previous line. -- * `buffer.CARETSTICKY_ON` -- 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. -- * `buffer.CARETSTICKY_WHITESPACE` -- Use the same position as on the previous line, but prior to any inserted -- indentation. -- -- The default value is `buffer.CARETSTICKY_OFF`. -- @field caret_style (number) -- The visual style of the caret. -- -- * `buffer.CARETSTYLE_INVISIBLE` -- No caret. -- * `buffer.CARETSTYLE_LINE` -- A line caret. -- * `buffer.CARETSTYLE_BLOCK` -- A block caret. -- -- The default value is `buffer.CARETSTYLE_LINE`. -- @field 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`. -- @field char_at (table, Read-only) -- Table of character bytes at positions starting from zero. -- @field column (table, Read-only) -- Table of column numbers, taking tab widths into account, for positions -- starting from zero. -- @field current_pos (number) -- The position of the caret. -- When set, does not scroll the caret into view. -- @field cursor (number) -- The display cursor type. -- -- * `buffer.CURSORNORMAL` -- The text insert cursor. -- * `buffer.CURSORARROW` -- The arrow cursor. -- * `buffer.CURSORWAIT` -- The wait cursor. -- * `buffer.CURSORREVERSEARROW` -- The reversed arrow cursor. -- -- The default value is `buffer.CURSORNORMAL`. -- @field dirty (bool) -- Whether or not the buffer has unsaved changes. -- This field is accessible from any buffer, not just the global one. -- @field edge_colour (number) -- The color, in "0xBBGGRR" format, marking long lines. -- @field edge_column (number) -- The column number to start marking long lines at. -- @field edge_mode (number) -- The long line mark mode. -- -- * `buffer.EDGE_NONE` -- Long lines are not marked. -- * `buffer.EDGE_LINE` -- Draw a vertical line whose color is [`buffer.edge_colour`](#edge_colour) -- at column [`buffer.edge_column`](#edge_column). -- * `buffer.EDGE_BACKGROUND` -- Change the background color of characters after column -- [`buffer.edge_column`](#edge_column) to -- [`buffer.edge_colour`](#edge_colour). -- @field encoding (string or nil) -- The string encoding of the file on the hard drive or `nil` for binary -- files. -- @field encoding_bom (string) -- The byte-order mark, if any, of the file encoding. -- @field end_at_last_line (bool) -- Disable scrolling past the last line. -- The default value is `true`. -- @field end_styled (number, Read-only) -- The position of the last correctly styled character. -- @field eol_mode (number) -- The current end of line mode. Changing the mode does not convert existing -- line endings. Use [`buffer:convert_eols()`](#convert_eols) to do so. -- -- * `buffer.EOL_CRLF` -- Carriage return with line feed ("\r\n"). -- * `buffer.EOL_CR` -- Carriage return ("\r"). -- * `buffer.EOL_LF` -- Line feed ("\n"). -- -- The default value is `buffer.EOL_CRLF` on Windows platforms, -- `buffer.EOL_LF` otherwise. -- @field extra_ascent (number) -- The amount of pixel padding above line text. -- The default value is `0`. -- @field extra_descent (number) -- The amount of pixel padding below line text. -- The default is `0`. -- @field filename (string) -- The absolute path to the file associated with the buffer. -- @field first_visible_line (number) -- The line number of the line at the top of the view, starting from zero. -- @field 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. -- @field fold_flags (number) -- Bit-mask of options for drawing folding lines. -- -- * `buffer.FOLDFLAG_LINEBEFORE_EXPANDED` -- Draw lines above expanded folds. -- * `buffer.FOLDFLAG_LINEBEFORE_CONTRACTED` -- Draw lines above collapsed folds. -- * `buffer.FOLDFLAG_LINEAFTER_EXPANDED` -- Draw lines below expanded folds. -- * `buffer.FOLDFLAG_LINEAFTER_CONTRACTED` -- Draw lines below collapsed folds. -- -- The default value is `0`. -- @field 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: -- -- * `buffer.FOLDLEVELBASE` -- The initial fold level. -- * `buffer.FOLDLEVELWHITEFLAG` -- The line is blank. -- * `buffer.FOLDLEVELHEADERFLAG` -- The line is a header, or fold point. -- @field 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. -- @field h_scroll_bar (bool) -- Display the horizontal scroll bar. -- The default value is `true`. -- @field highlight_guide (number) -- The indentation guide column number to highlight, or `0` to stop -- highlighting. -- @field hotspot_active_underline (bool) -- Underline active hotspots. -- The default value is `true`. -- @field hotspot_single_line (bool) -- Limit hotspots to a single line. -- The default value is `true`. -- @field indent (number) -- The number of spaces in one level of indentation. -- The default value is `0`, which uses the value of -- [`buffer.tab_width`](#tab_width). -- @field indentation_guides (number) -- The indentation guide drawing mode. -- Indentation guides are dotted vertical lines that appear within indentation -- whitespace at each level of indentation. -- -- * `buffer.IV_NONE` -- Does not draw any guides. -- * `buffer.IV_REAL` -- Draw guides only within indentation whitespace. -- * `buffer.IV_LOOKFORWARD` -- 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. -- * `buffer.IV_LOOKBOTH` -- 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 `buffer.IV_NONE`. -- @field 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 `buffer.ALPHA_NOALPHA`, for no alpha. -- @field indic_fore (table) -- Table of foreground colors, in "0xBBGGRR" format, for indicator numbers -- from `0` to `31`. -- @field 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 `buffer.ALPHA_NOALPHA`, for no alpha. -- @field indic_style (table) -- Table of styles for indicator numbers from `0` to `31`. -- -- * `buffer.INDIC_PLAIN` -- An underline. -- * `buffer.INDIC_SQUIGGLE` -- A squiggly underline 3 pixels in height. -- * `buffer.INDIC_TT` -- A line of small 'T' shapes. -- * `buffer.INDIC_DIAGONAL` -- Diagonal hatching. -- * `buffer.INDIC_STRIKE` -- Strike out. -- * `buffer.INDIC_HIDDEN` -- Invisible. -- * `buffer.INDIC_BOX` -- A rectangle around the text. -- * `buffer.INDIC_ROUNDBOX` -- 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`. -- * `buffer.INDIC_STRAIGHTBOX` -- Similar to `INDIC_ROUNDBOX` but with sharp corners. -- * `buffer.INDIC_DASH` -- A dashed underline. -- * `buffer.INDIC_DOTS` -- A dotted underline. -- * `buffer.INDIC_SQUIGGLELOW` -- A squiggly underline 2 pixels in height. -- * `buffer.INDIC_DOTBOX` -- 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. -- * `buffer.INDIC_SQUIGGLEPIXMAP` -- Identical to `INDIC_SQUIGGLE` but draws faster by using a pixmap instead -- of multiple line segments. -- * `buffer.INDIC_COMPOSITIONTHICK` -- 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 -- @field indic_under (table) -- Table of flags indicating whether or not to draw indicators behind text -- instead of over the top of 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`. -- @field 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). -- @field length (number, Read-only) -- The number of bytes in the buffer. -- @field line_count (number, Read-only) -- The number of lines in the buffer. -- There is always at least one. -- @field 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. -- @field line_indent_position (table, Read-only) -- Table of positions at the ends of indentation for line numbers starting -- from zero. -- @field line_indentation (table) -- Table of indentation amounts in character columns, for line numbers -- starting from zero. -- @field 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. -- @field line_visible (table, Read-only) -- Table of flags indicating whether or not lines are visible for line numbers -- starting from zero. -- @field 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. -- @field main_selection (number) -- The number of the main, or most recent, selection. -- Only an existing selection can be made main. -- @field margin_cursor_n (table) -- Table of cursor types shown over margin numbers from zero to four. -- -- * `buffer.CURSORARROW` -- Normal arrow cursor. -- * `buffer.CURSORREVERSEARROW` -- Reversed arrow cursor. -- -- The default values are `buffer.CURSORREVERSEARROW`. -- @field margin_left (number) -- The pixel size of the left margin of the buffer text. -- The default value is `1`. -- @field margin_mask_n (table) -- Table of bit-masks of markers that symbol margins can display for margin -- numbers from zero to four. -- Bit-masks are 32-bit values whose bits correspond to the 32 available -- markers. -- The default values are `0`, `bit32.bnot(buffer.MASK_FOLDERS)`, `0`, `0`, -- and `0`, for a line margin and logical marker margin. -- @field margin_options (number) -- A bit-mask of margin option settings. -- -- * `buffer.MARGINOPTION_NONE` -- None. -- * `buffer.MARGINOPTION_SUBLINESELECT` -- Select only the sub-line of the wrapped line, rather than the entire -- line, on margin click. -- -- The default value is `buffer.MARGINOPTION_NONE`. -- @field margin_right (number) -- The pixel size of the right margin of the buffer text. -- The default value is `1`. -- @field 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`. -- @field margin_style (table) -- Table of style numbers for line numbers starting from zero in the text -- margin. -- Only some style attributes are active in text margins: font, size, bold, -- italics, fore, and back. -- @field margin_style_offset (number) -- The beginning of the range of style numbers used for margin text. -- Always set this to the result of -- [`buffer.allocate_extended_styles`](#allocate_extended_styles). -- Margin styles may be completely separated from standard text styles by -- setting a style offset. For example, when set to `256`, margin styles are -- 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. -- The default value is `0`. -- @field margin_text (table) -- Table of text displayed in text margins for line numbers starting from -- zero. -- @field margin_type_n (table) -- Table of margin types for margin numbers from zero to four. -- -- * `buffer.MARGIN_SYMBOL` -- A symbol margin. -- * `buffer.MARGIN_NUMBER` -- A line number margin. -- * `buffer.MARGIN_BACK` -- A symbol margin whose background color matches the default text -- background color. -- * `buffer.MARGIN_FORE` -- A symbol margin whose foreground color matches the default text -- foreground color. -- * `buffer.MARGIN_TEXT` -- A text margin. -- * `buffer.MARGIN_RTEXT` -- A right-justified text margin. -- -- The default values are `true`, `false`, `false`, `false`, and `false`, for -- a line number margin and symbol margins. -- @field margin_width_n (table) -- Table of pixel margin widths for margin numbers from zero to four. -- @field marker_alpha (table, Write-only) -- Table of alpha values, ranging from `0` (transparent) to `255` (opaque), -- of markers drawn in the text area, not the margin, for markers numbers from -- `0` to `31`. -- The default values are `buffer.ALPHA_NOALPHA`, for no alpha. -- @field marker_back (table, Write-only) -- Table of background colors, in "0xBBGGRR" format, of marker numbers from -- `0` to `31`. -- @field marker_back_selected (table, Write-only) -- Table of background colors, in "0xBBGGRR" format, of markers whose folding -- blocks are selected for marker numbers from `0` to `31`. -- @field marker_fore (table, Write-only) -- Table of foreground colors, in "0xBBGGRR" format, of marker numbers from -- `0` to `31`. -- @field max_line_state (number, Read-only) -- The last line number with a non-zero line state. -- @field mouse_dwell_time (number) -- The number of milliseconds the mouse must idle before generating a -- `DWELL_START` event. A time of `buffer.TIME_FOREVER` will never generate -- one. -- @field multi_paste (number) -- The multiple selection paste mode. -- -- * `buffer.MULTIPASTE_ONCE` -- Paste into only the main selection. -- * `buffer.MULTIPASTE_EACH` -- Paste into all selections. -- -- The default value is `buffer.MULTIPASTE_ONCE`. -- @field multiple_selection (bool) -- Enable multiple selection. -- The default value is `false`. -- @field overtype (bool) -- Enable overtype mode, where typed characters overwrite existing ones. -- The default value is `false`. -- @field property (table) -- Map of key-value string pairs used by lexers. -- @field property_expanded (table, Read-only) -- Map of key-value string pairs used by lexers with `%()` variable -- replacement performed in values. -- @field property_int (table, Read-only) -- Map of key-value pairs used by lexers with values interpreted as numbers, -- or `0` if not found. -- @field punctuation_chars (string) -- The string set of characters recognized as 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. -- @field read_only (bool) -- Whether or not the buffer is read-only. -- The default value is `false`. -- @field rectangular_selection_anchor (number) -- The position of the anchor of the rectangular selection. -- @field rectangular_selection_anchor_virtual_space (number) -- The amount of virtual space for the anchor of the rectangular selection. -- @field rectangular_selection_caret (number) -- The position of the caret of the rectangular selection. -- @field rectangular_selection_caret_virtual_space (number) -- The amount of virtual space for the caret of the rectangular selection. -- @field rectangular_selection_modifier (number) -- The modifier key used in combination with a mouse drag to create a -- rectangular selection. -- -- * `buffer.MOD_CTRL` -- The "Control" modifier key. -- * `buffer.MOD_ALT` -- The "Alt" modifier key. -- * `buffer.MOD_SUPER` -- The "Super" modifier key, usually defined as the left "Windows" or -- "Command" key. -- -- The default value is `buffer.MOD_CTRL`. -- @field rgba_image_height (number) -- The height for the RGBA image to be defined using -- [`buffer:marker_define_rgba_image()`](#marker_define_rgba_image). -- @field rgba_image_scale (number) -- The scale factor in percent for the 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 displayed using a -- screen pixel. The default scale, `100`, will stretch each image pixel to -- cover 4 screen pixels on a retina display. -- @field rgba_image_width (number) -- The width for the RGBA image to be defined using -- [`buffer:marker_define_rgba_image()`](#marker_define_rgba_image) and -- [`buffer:register_rgba_image()`](#register_rgba_image). -- @field 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`. -- @field scroll_width_tracking (bool) -- Continuously update the scroll width to match the maximum width of a -- displayed line beyond [`buffer.scroll_width`](#scroll_width). -- The default value is `false`. -- @field search_flags (number) -- The bit-mask of search flags used by -- [`buffer:search_in_target()`](#search_in_target). -- -- * `buffer.FIND_WHOLEWORD` -- Match text surrounded by non-word characters. -- * `buffer.FIND_MATCHCASE` -- Match text case sensitively. -- * `buffer.FIND_WORDSTART` -- Match text only when the previous character is a non-word character. -- * `buffer.FIND_REGEXP` -- Interpret the search string as a regular expression. -- * `buffer.FIND_POSIX` -- 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. -- * `\>` -- Matches the end of a word. -- * `^` -- 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. -- @field sel_alpha (number) -- The alpha value, ranging from `0` (transparent) to `255` (opaque), of the -- selection. -- The default value is `buffer.ALPHA_NOALPHA`, for no alpha. -- @field sel_eol_filled (bool) -- Extend the selection to the right margin of the view. -- The default value is `false`. -- @field selection_empty (bool, Read-only) -- Whether or not no text is selected. -- @field selection_end (number) -- The position of the end of the selected text. -- When set, becomes the current position, but is not scrolled into view. -- @field selection_is_rectangle (bool, Read-only) -- Whether or not the selection is a rectangular selection. -- @field selection_mode (number) -- The selection mode. -- -- * `buffer.SEL_STREAM` -- Character selection. -- * `buffer.SEL_RECTANGLE` -- Rectangular selection. -- * `buffer.SEL_LINES` -- Line selection. -- * `buffer.SEL_THIN` -- 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. -- @field selection_n_anchor (table) -- Table of positions at the beginning of existing selections numbered from -- zero, the main selection. -- @field selection_n_anchor_virtual_space (table) -- Table of positions at the beginning of virtual space selected in existing -- selections numbered from zero, the main selection. -- @field selection_n_caret (table) -- Table of positions at the end of existing selections numbered from zero, -- the main selection. -- @field selection_n_caret_virtual_space (table) -- Table of positions at the end of virtual space selected in existing -- selections numbered from zero, the main selection. -- @field selection_n_end (table) -- Table of positions at the end of existing selections numbered from zero, -- the main selection. -- @field selection_n_start (table) -- Table of positions at the beginning of existing selections numbered from -- zero, the main selection. -- @field selection_start (number) -- The position of the beginning of the selected text. -- When set, becomes the anchor, but is not scrolled into view. -- @field selections (number, Read-only) -- The number of active selections. -- @field style_at (table, Read-only) -- Table of style numbers at positions starting from zero. -- @field style_back (table) -- Table of background colors, in "0xBBGGRR" format, of text within styles for -- style numbers from `0` to `255`. -- @field 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`. -- @field style_case (table) -- Table of letter case modes of text within styles for style numbers from `0` -- to `255`. -- -- * `buffer.CASE_MIXED` -- Display text in normally. -- * `buffer.CASE_UPPER` -- Display text in upper case. -- * `buffer.CASE_LOWER` -- Display text in lower case. -- -- The default values are `buffer.CASE_MIXED`. -- @field 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. -- @field style_eol_filled (table) -- Table of flags indicating whether or not the background colors of styles -- whose characters occur last on lines extend all the way to the right margin -- of the view for style numbers from `0` to `255`. -- The default values are `false`. -- @field style_font (table) -- Table of string font faces of text within styles for style numbers from -- `0` to `255`. -- @field style_fore (table) -- Table of foreground colors, in "0xBBGGRR" format, of text within styles for -- style numbers from `0` to `255`. -- @field 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`. -- @field 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`. -- @field style_name (table, Read-only) -- Table of style names for style numbers from `0` to `255`. -- @field style_size (table) -- Table of font sizes of text within styles for style numbers from `0` to -- `255`. -- @field 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`. -- @field 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`. -- @field tab_indents (bool) -- Tabbing indents within indentation. -- The default value is `false`. -- @field tab_width (number) -- The number of space characters represented by a tab character. -- The default value is `8`. -- @field tag (table, Read-only) -- List of values for tag match numbers from a regular expression search. -- @field 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). -- @field 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). -- @field text_length (number, Read-only) -- The number of bytes in the buffer. -- @field two_phase_draw (bool) -- Draw in two phases: first the background and then the foreground. -- The default value is `true`. -- @field 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`. -- @field use_tabs (bool) -- Use tabs instead of spaces in indentation. Changing the setting does not -- convert existing indentation. Use -- [`textadept.editing.convert_indentation()`][] to do so. -- The default value is `true`. -- @field v_scroll_bar (bool) -- Display the vertical scroll bar. -- The default value is `true`. -- @field view_eol (bool) -- Display end of line characters. -- The default value is `false`. -- @field view_ws (number) -- The whitespace character visibility mode. -- -- * `buffer.WS_INVISIBLE` -- Whitespace is invisible. -- * `buffer.WS_VISIBLEALWAYS` -- Display all whitespace as dots and arrows. -- * `buffer.WS_VISIBLEAFTERINDENT` -- Display only non-indentation whitespace as dots and arrows. -- -- The default value is `buffer.WS_INVISIBLE`. -- @field virtual_space_options (number) -- The virtual space mode. -- -- * `buffer.VS_NONE` -- Disable virtual space. -- * `buffer.VS_RECTANGULARSELECTION` -- Enable virtual space only for rectangular selections. -- * `buffer.VS_USERACCESSIBLE` -- Enable virtual space. -- -- When virtual space is enabled, the caret may move into the space past the -- ends of lines. -- The default value is `buffer.VS_NONE`. -- @field whitespace_chars (string) -- The string set of characters recognized as whitespace characters. -- 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. -- @field whitespace_size (number) -- The pixel size of the dots representing space characters when whitespace is -- visible. -- The default value is `1`. -- @field word_chars (string) -- The string set of characters recognized as word characters. -- The default value is a string containing alphanumeric characters, an -- underscore, and all characters greater than ASCII value 127. -- @field wrap_indent_mode (number) -- The wrapped line indent mode. -- -- * `buffer.WRAPINDENT_FIXED` -- Indent wrapped lines by [`buffer.wrap_start_indent`](#wrap_start_indent). -- * `buffer.WRAPINDENT_SAME` -- Indent wrapped lines the same as the first line. -- * `buffer.WRAPINDENT_INDENT` -- Indent wrapped lines one more level than the first line. -- -- The default value is `buffer.WRAPINDENT_FIXED`. -- @field wrap_mode (number) -- Long line wrap mode. -- -- * `buffer.WRAP_NONE` -- Long lines are not wrapped. -- * `buffer.WRAP_WORD` -- Wrap long lines at word boundaries. -- * `buffer.WRAP_CHAR` -- Wrap long lines at character boundaries. -- -- The default value is `buffer.WRAP_NONE`. -- @field wrap_start_indent (number) -- The number of spaces to indent wrapped lines by if -- [`buffer.wrap_indent_mode`](#wrap_indent_mode) is -- `buffer.WRAP_INDENT_FIXED`. -- The default value is `0`. -- @field wrap_visual_flags (number) -- The wrapped line visual display mode. -- -- * `buffer.WRAPVISUALFLAG_NONE` -- No visual flags. -- * `buffer.WRAPVISUALFLAG_END` -- Show visual flag at the end of the line. -- * `buffer.WRAPVISUALFLAG_START` -- Show visual flag at the beginning of the sub-line. -- * `buffer.WRAPVISUALFLAG_MARGIN` -- Show visual flag in the line number margin of the sub-line. -- -- The default value is `buffer.WRAPVISUALFLAG_NONE`. -- @field wrap_visual_flags_location (number) -- The wrapped line visual flag drawing mode. -- -- * `buffer.WRAPVISUALFLAGLOC_DEFAULT` -- Draw the visual flag near the right border. -- * `buffer.WRAPVISUALFLAGLOC_END_BY_TEXT` -- Draw the visual flag near text at the end of the line. -- * `buffer.WRAPVISUALFLAGLOC_START_BY_TEXT` -- Draw the visual flag near text at the beginning of the subline. -- -- The default value is `buffer.WRAPVISUALFLAGLOC_DEFAULT`. -- @field 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. -- @field zoom (number) -- The number of points to add to the size of all fonts. -- Negative values are allowed. -- The default value is `0`. -- -- [`textadept.editing.convert_indentation()`]: textadept.editing.html#convert_indentation module('buffer') --- -- Selects the range of text between positions *start_pos* to *end_pos* as the -- main selection, retaining all other selections as additional selections. -- Since an empty selection still counts as a selection, use -- `buffer:set_selection()` first when setting a list of selections. -- @param buffer The global buffer. -- @param end_pos The caret position of the range of text to select in *buffer*. -- @param start_pos The anchor position of the range of text to select in -- *buffer*. function add_selection(buffer, end_pos, start_pos) end --- -- Adds string *text* to the buffer at the caret position and moves the caret to -- the end of the added text without scrolling it into view. -- @param buffer The global buffer. -- @param text The text to add. function add_text(buffer, text) end --- -- Allocates an additional *num_styles* number of styles for use by margins or -- annotations and returns the starting style number of the new range. -- These styles are outside the 0..255 range used by lexers. -- @param buffer The global buffer -- @param num_styles The number of additional styles to allocate. -- @return number -- @see annotation_style_offset -- @see margin_style_offset function allocate_extended_styles(buffer, num_styles) end --- -- Clears annotations from all lines. -- @param buffer The global buffer. function annotation_clear_all(buffer) end --- -- Appends string *text* to the end of the buffer without modifying any existing -- selections or scrolling the text into view. -- @param buffer The global buffer. -- @param text The text to append. function append_text(buffer, text) end --- -- Returns whether or not the autocompletion list is visible. -- @param buffer The global buffer. -- @return bool function auto_c_active(buffer) end --- -- Cancels the autocompletion list. -- @param buffer The global buffer. function auto_c_cancel(buffer) end --- -- Autocompletes the selected word in the autocompletion list. -- @param buffer The global buffer. function auto_c_complete(buffer) end --- -- Returns the position where autocompletion started at. -- @param buffer The global buffer. -- @return number function auto_c_pos_start(buffer) end --- -- Selects the first item in the autocompletion list that starts with *string*, -- considering case sensitiveness based on `buffer.auto_c_ignore_case`. -- @param buffer The global buffer. -- @param string The item in the list to select. function auto_c_select(buffer, string) end --- -- Displays an autocompletion list constructed from string *item_list*, 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 have already -- been defined. -- @param buffer The global buffer. -- @param len_entered The number of characters before the caret used to provide -- the context. -- @param item_list The sorted string of words to show, separated by -- `buffer.auto_c_separator` characters (initially spaces). function auto_c_show(buffer, len_entered, item_list) end --- -- Defines string *chars* as the set of characters that cancels an -- autocompletion or user list when typed. -- The default set is an empty string. -- @param buffer The global buffer. -- @param chars The string of characters that cancel autocompletion. This string -- is empty by default. function auto_c_stops(buffer, chars) end --- -- Un-indents the text on the selected lines. -- @param buffer The global buffer. function back_tab(buffer) end --- -- Starts a sequence of actions to undo or redo as a single action. -- May be nested. -- @param buffer The global buffer. function begin_undo_action(buffer) end --- -- Highlights the character at position *pos* as an unmatched brace character -- using the `'style.bracebad'` style. -- Removes highlighting when *pos* is `-1`. -- @param buffer The global buffer. -- @param pos The position in *buffer* to highlight, or `-1` to remove the -- highlight. function brace_bad_light(buffer, pos) end --- -- Highlights unmatched brace characters with indicator number *indic_num*, in -- the range of `0` to `31`, instead of the -- `buffer.STYLE_BRACEBAD` style if *use_indicator* is `true`. -- @param buffer The global buffer. -- @param use_indicator Whether or not to use an indicator. -- @param indic_num The indicator number to use. function brace_bad_light_indicator(buffer, use_indicator, indic_num) end --- -- Highlights the characters at positions *pos1* and *pos2* as matching braces -- using the `'style.bracelight'` style. -- If indent guides are enabled, locates the column with `buffer.column` and -- sets `buffer.highlight_guide` in order to highlight the indent guide. -- @param buffer The global buffer. -- @param pos1 The first position in *buffer* to highlight. -- @param pos2 The second position in *buffer* to highlight. function brace_highlight(buffer, pos1, pos2) end --- -- Highlights matching brace characters with indicator number *indic_num*, in -- the range of `0` to `31`, instead of the -- `buffer.STYLE_BRACELIGHT` style if *use_indicator* is `true`. -- @param buffer The global buffer. -- @param use_indicator Whether or not to use an indicator. -- @param indic_num The indicator number to use. function brace_highlight_indicator(buffer, use_indicator, indic_num) end --- -- 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. -- @param buffer The global buffer. -- @param pos The position of the brace in *buffer* to match. -- @return number function brace_match(buffer, pos) end --- -- Returns whether or not the call tip is visible. -- @param buffer The global buffer. -- @return bool function call_tip_active(buffer) end --- -- Removes the call tip from view. -- @param buffer The global buffer. function call_tip_cancel(buffer) end --- -- Returns the position where the call tip displayed at. -- @param buffer The global buffer. -- @return number function call_tip_pos_start(buffer) end --- -- Highlights the call tip text between positions *start_pos*, starting from -- zero, to *end_pos* with the color `buffer.call_tip_fore_hlt`. -- @param buffer The global buffer. -- @param start_pos The start position in the call tip text to highlight. -- @param end_pos The end position in the call tip text to highlight. function call_tip_set_hlt(buffer, start_pos, end_pos) end --- -- 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. -- @param buffer The global buffer. -- @param pos The position in *buffer* to show the call tip at. -- @param text The call tip text to show. function call_tip_show(buffer, pos, text) end --- -- Returns whether or not there is an action to redo. -- @param buffer The global buffer. -- @return bool function can_redo(buffer) end --- -- Returns whether or not there is an action to undo. -- @param buffer The global buffer. -- @return bool function can_undo(buffer) end --- -- Cancels the active call tip, autocompletion or user list, selection mode, -- etc. -- @param buffer The global buffer. function cancel(buffer) end --- -- Tells the lexer to re-process the range of text between *start_pos* and -- *end_pos*. -- @param buffer The global buffer. -- @param start_pos The start position of the range of text in *buffer* to -- re-process. -- @param end_pos The end position of the range of text in *buffer* to -- re-process. function change_lexer_state(buffer, start_pos, end_pos) end --- -- Moves the caret left one character. -- @param buffer The global buffer. function char_left(buffer) end --- -- Moves the caret left one character, extending the selected text to the new -- position. -- @param buffer The global buffer. function char_left_extend(buffer) end --- -- Moves the caret left one character, extending the rectangular selection to -- the new position. -- @param buffer The global buffer. function char_left_rect_extend(buffer) end --- -- Returns the position closest to view coordinates *x* and *y*. -- @param buffer The global buffer. -- @param x The x-coordinate in the view to use. -- @param y The y-coordinate in the view to use. -- @return number function char_position_from_point(buffer, x, y) end --- -- Returns the position closest to view coordinates *x* and *y*, or `-1` if the -- point is outside the window or not close to any text. -- @param buffer The global buffer. -- @param x The x-coordinate in the view to use. -- @param y The y-coordinate in the view to use. -- @return number function char_position_from_point_close(buffer, x, y) end --- -- Moves the caret right one character. -- @param buffer The global buffer. function char_right(buffer) end --- -- Moves the caret right one character, extending the selected text to the new -- position. -- @param buffer The global buffer. function char_right_extend(buffer) end --- -- Moves the caret right one character, extending the rectangular selection to -- the new position. -- @param buffer The global buffer. function char_right_rect_extend(buffer) end --- -- Sets the preferred horizontal position of the caret when moving between -- lines to the current position. -- @param buffer The global buffer. -- @see caret_sticky function choose_caret_x(buffer) end --- -- Deletes the selected text or the character at the caret. -- @param buffer The global buffer. function clear(buffer) end --- -- Deletes the buffer's text. -- @param buffer The global buffer. function clear_all(buffer) end --- -- Clears all styling and folding information. -- @param buffer The global buffer. function clear_document_style(buffer) end --- -- Clears all images registered using `buffer:register_image()` and -- `buffer:register_rgba_image()`. -- @param buffer The global buffer. function clear_registered_images(buffer) end --- -- Removes all selections and moves the caret to the beginning of the buffer. -- @param buffer The global buffer. function clear_selections(buffer) end --- -- Tells the lexer to style and fold the range of text between *start_pos* and -- *end_pos*. -- If *end_pos* is `-1`, styles and folds to the end of the buffer. -- @param buffer The global buffer. -- @param start_pos The start position of the range of text in *buffer* to -- process. -- @param 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*. function colourise(buffer, start_pos, end_pos) end --- -- Returns the line number of the next contracted fold header line starting at -- *line_start*, or `-1`. -- @param buffer The global buffer. -- @param line_start The line number in *buffer* to start at. -- @return number function contracted_fold_next(buffer, line_start) end --- -- Converts all line endings to end of line mode *mode*. -- @param buffer The global buffer. -- @param mode The line ending mode to convert to. Valid values are: -- * `buffer.EOL_CRLF` -- * `buffer.EOL_CR` -- * `buffer.EOL_LF` function convert_eols(buffer, mode) end --- -- 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. -- @param buffer The global buffer. function copy(buffer) end --- -- Copies the selected text or the current line to the clipboard. -- @param buffer The global buffer. function copy_allow_line(buffer) end --- -- Copies the range of text between positions *start_pos* and *end_pos* to the -- clipboard. -- @param buffer The global buffer. -- @param start_pos The start position of the range of text in *buffer* to copy. -- @param end_pos The end position of the range of text in *buffer* to copy. function copy_range(buffer, start_pos, end_pos) end --- -- Copies string *text* to the clipboard. -- @param buffer The global buffer. -- @param text The text to copy. function copy_text(buffer, text) end --- -- Returns the number of whole characters between positions *start_pos* and -- *end_pos*. -- @param buffer The global buffer. -- @param start_pos The start position of the range of text in *buffer* to start -- counting at. -- @param end_pos The end position of the range of text in *buffer* to stop -- counting at. -- @return number function count_characters(buffer, start_pos, end_pos) end --- -- 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. -- @param buffer The global buffer. function cut(buffer) end --- -- Deletes text from the caret to the beginning of the line. -- @param buffer The global buffer. function del_line_left(buffer) end --- -- Deletes text from the caret to the end of the line. -- @param buffer The global buffer. function del_line_right(buffer) end --- -- Deletes the word to the left of the caret, including any leading non-word -- characters. -- `buffer.word_chars` contains word characters. -- @param buffer The global buffer. function del_word_left(buffer) end --- -- Deletes the word to the right of the caret, including any trailing non-word -- characters. -- `buffer.word_chars` contains word characters. -- @param buffer The global buffer. function del_word_right(buffer) end --- -- Deletes the word to the right of the caret, excluding any trailing non-word -- characters. -- `buffer.word_chars` contains word characters. -- @param buffer The global buffer. function del_word_right_end(buffer) end --- -- Deletes the selected text or the character behind the caret. -- @param buffer The global buffer. function delete_back(buffer) end --- -- Deletes the selected text or the character behind the caret unless the caret -- is at the beginning of a line. -- @param buffer The global buffer. function delete_back_not_line(buffer) end --- -- Deletes the buffer's text from position *pos* to *pos* + *length*. -- @param buffer The global buffer. -- @param pos The start position of the range of text in *buffer* to delete. -- @param length The number of characters in the range of text to delete. function delete_range(buffer, pos, length) end --- -- 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`. -- @param buffer The global buffer. -- @param display_line The display line number to use. -- @return number function doc_line_from_visible(buffer, display_line) end --- -- Moves the caret to the end of the buffer. -- @param buffer The global buffer. function document_end(buffer) end --- -- Moves the caret to the end of the buffer, extending the selected text to the -- new position. -- @param buffer The global buffer. function document_end_extend(buffer) end --- -- Moves the caret to the beginning of the buffer. -- @param buffer The global buffer. function document_start(buffer) end --- -- Moves the caret to the beginning of the buffer, extending the selected text -- to the new position. -- @param buffer The global buffer. function document_start_extend(buffer) end --- -- Toggles `buffer.overtype`. -- @param buffer The global buffer. function edit_toggle_overtype(buffer) end --- -- Deletes the undo and redo history. -- @param buffer The global buffer. function empty_undo_buffer(buffer) end --- -- Ends a sequence of actions to undo or redo as a single action. -- @param buffer The global buffer. function end_undo_action(buffer) end --- -- Ensures line number *line* is visible by expanding any fold header lines -- hiding it. -- @param buffer The global buffer. -- @param line The line number in *buffer* to ensure visible. function ensure_visible(buffer, line) end --- -- 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()`. -- @param buffer The global buffer. -- @param line The line number in *buffer* to ensure visible. function ensure_visible_enforce_policy(buffer, line) end --- -- Expands the fold states of the fold header on line number *line* and its -- children with fold level *level*. -- @param buffer The global buffer. -- @param line The line number in *buffer* to expand the folds for. -- @param 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. function expand_children(buffer, line, level) end --- -- 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*. -- @param buffer The global buffer. -- @param line The line number in *buffer* to use. -- @param column The column number to use. function find_column(buffer, line, column) end --- -- Expands, contracts, or toggles the fold states of all fold headers, depending -- on *action*. -- When toggling, the state of the first fold header determines whether to -- expand or contract. -- @param buffer The global buffer. -- @param action The fold action to perform. Valid values are: -- * `buffer.FOLDACTION_CONTRACT` -- * `buffer.FOLDACTION_EXPAND` -- * `buffer.FOLDACTION_TOGGLE` function fold_all(buffer, action) end --- -- Expands, contracts, or toggles the fold states of the fold header on line -- number *line* and its children, depending on *action*. -- @param buffer The global buffer. -- @param line The line number in *buffer* to set the fold states for. -- @param action The fold action to perform. Valid values are: -- * `buffer.FOLDACTION_CONTRACT` -- * `buffer.FOLDACTION_EXPAND` -- * `buffer.FOLDACTION_TOGGLE` function fold_children(buffer, line, action) end --- -- Expands, contracts, or toggles the fold state of the fold header on line -- number *line*, depending on *action*. -- @param buffer The global buffer. -- @param line The line number in *buffer* to set the fold state for. -- @param action The fold action to perform. Valid values are: -- * `buffer.FOLDACTION_CONTRACT` -- * `buffer.FOLDACTION_EXPAND` -- * `buffer.FOLDACTION_TOGGLE` function fold_line(buffer, line, action) end --- -- Types a Form Feed ("\f") character at the caret position. -- @param buffer The global buffer. function form_feed(buffer) end --- -- Returns the current line's text and the index of the caret on the line, -- starting from zero. -- @param buffer The global buffer. -- @return string, number function get_cur_line(buffer) end --- -- Returns the numeric background color of active hotspots. -- @param buffer The global buffer. -- @return number function get_hotspot_active_back(buffer) end --- -- Returns the numeric foreground color of active hotspots. -- @param buffer The global buffer. -- @return number function get_hotspot_active_fore(buffer) end --- -- 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`. -- @param buffer The global buffer. -- @param start_line The line number in *buffer* of a header line. -- @param level The fold level, or `-1` for the level of *start_line*. function get_last_child(buffer, start_line, level) end --- -- Returns the text on line number *line*, including end of line characters. -- @param buffer The global buffer. -- @param line The line number in *buffer* to use. -- @return string, number function get_line(buffer, line) end --- -- Returns the position of the end of the selected text on line number *line*, -- or `-1`. -- @param buffer The global buffer. -- @param line The line number in *buffer* to use. function get_line_sel_end_position(buffer, line) end --- -- Returns the position of the beginning of the selected text on line number -- *line*, or `-1`. -- @param buffer The global buffer. -- @param line The line number in *buffer* to use. function get_line_sel_start_position(buffer, line) end --- -- Returns the selected text. -- 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. -- @param buffer The global buffer. -- @return string, number function get_sel_text(buffer) end --- -- Returns the buffer's text. -- @param buffer The global buffer. function get_text(buffer) end --- -- Moves the caret to the beginning of line number *line* and scrolls it into -- view. -- @param buffer The global buffer. -- @param line The line number in *buffer* to go to. function goto_line(buffer, line) end --- -- Moves the caret to position *pos* and scrolls it into view. -- @param buffer The global buffer. -- @param pos The position in *buffer* to go to. function goto_pos(buffer, pos) end --- -- 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. -- @param buffer The global buffer. -- @param start_line The start line of the range of lines in *buffer* to hide. -- @param end_line The end line of the range of lines in *buffer* to hide. function hide_lines(buffer, start_line, end_line) end --- -- Do not highlight selected text if *hide* is `true`. -- @param buffer The global buffer. -- @param hide Whether or not to hide the selection. function hide_selection(buffer, hide) end --- -- Moves the caret to the beginning of the current line. -- @param buffer The global buffer. function home(buffer) end --- -- Moves the caret to the beginning of the current wrapped line. -- @param buffer The global buffer. function home_display(buffer) end --- -- Moves the caret to the beginning of the current wrapped line, extending the -- selected text to the new position. -- @param buffer The global buffer. function home_display_extend(buffer) end --- -- Moves the caret to the beginning of the current line, extending the selected -- text to the new position. -- @param buffer The global buffer. function home_extend(buffer) end --- -- Moves the caret to beginning of the current line, extending the rectangular -- selection to the new position. -- @param buffer The global buffer. function home_rect_extend(buffer) end --- -- Moves the caret to beginning of the current wrapped line, or if already -- there, to the beginning of the actual line. -- @param buffer The global buffer. function home_wrap(buffer) end --- -- Like `buffer:home_wrap()`, but extends the selected text to the new position. -- @param buffer The global buffer. function home_wrap_extend(buffer) end --- -- 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. -- @param buffer The global buffer. -- @param pos The position in *buffer* to get indicators at. -- @return number function indicator_all_on_for(buffer, pos) end --- -- Clears indicator `buffer.indicator_current` over the range of text from -- position *pos* to *pos* + *clear_length*. -- @param buffer The global buffer. -- @param pos The start position of the range of text in *buffer* to clear -- indicators over. -- @param clear_length The number of characters in the range of text to clear -- indicators over. function indicator_clear_range(buffer, pos, clear_length) end --- -- Returns the end position of indicator number *indicator*, in the range of `0` -- to `31`, at position *pos*. -- @param buffer The global buffer. -- @param indicator An indicator number in the range of `0` to `31`. -- @param pos The position in *buffer* of the indicator. function indicator_end(buffer, indicator, pos) end --- -- Sets indicator number `buffer.indicator_current` over the range of text from -- position *pos* to *pos* + *fill_length*. -- @param buffer The global buffer. -- @param pos The start position of the range of text in *buffer* to set -- indicators over. -- @param fill_length The number of characters in the range of text to set -- indicators over. function indicator_fill_range(buffer, pos, fill_length) end --- -- Returns the position of the beginning of indicator number *indicator*, in the -- range of `0` to `31`, at position *pos*. -- @param buffer The global buffer. -- @param indicator An indicator number in the range of `0` to `31`. -- @param pos The position in *buffer* of the indicator. function indicator_start(buffer, indicator, pos) end --- -- Inserts string *text* at position *pos* or the caret position if *pos* is -- `-1`, removing any selections. -- If the caret is after the *pos*, it is moved appropriately, but not scrolled -- into view. -- @param buffer The global buffer. -- @param pos The position in *buffer* to insert text at, or `-1` for the -- current position. -- @param text The text to insert. function insert_text(buffer, pos, text) end --- -- Copies the current line to the clipboard. -- @param buffer The global buffer. function line_copy(buffer) end --- -- Cuts the current line to the clipboard. -- @param buffer The global buffer. function line_cut(buffer) end --- -- Deletes the current line. -- @param buffer The global buffer. function line_delete(buffer) end --- -- Moves the caret down one line. -- @param buffer The global buffer. function line_down(buffer) end --- -- Moves the caret down one line, extending the selected text to the new -- position. -- @param buffer The global buffer. function line_down_extend(buffer) end --- -- Moves the caret down one line, extending the rectangular selection to the new -- position. -- @param buffer The global buffer. function line_down_rect_extend(buffer) end --- -- Duplicates the current line on a new line below. -- @param buffer The global buffer. function line_duplicate(buffer) end --- -- Moves the caret to the end of the current line. -- @param buffer The global buffer. function line_end(buffer) end --- -- Moves the caret to the end of the current wrapped line. -- @param buffer The global buffer. function line_end_display(buffer) end --- -- Moves the caret to the end of the current wrapped line, extending the -- selected text to the new position. -- @param buffer The global buffer. function line_end_display_extend(buffer) end --- -- Moves the caret to the end of the current line, extending the selected text -- to the new position. -- @param buffer The global buffer. function line_end_extend(buffer) end --- -- Moves the caret to the end of the current line, extending the rectangular -- selection to the new position. -- @param buffer The global buffer. function line_end_rect_extend(buffer) end --- -- Moves the caret to the end of the current wrapped line, or if already there, -- to the end of the actual line. -- @param buffer The global buffer. function line_end_wrap(buffer) end --- -- Like `buffer:line_end_wrap()`, but extends the selected text to the new -- position. -- @param buffer The global buffer. function line_end_wrap_extend(buffer) end --- -- 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`. -- @param buffer The global buffer. -- @param pos The position in *buffer* to get the line number of. -- @return number function line_from_position(buffer, pos) end --- -- 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)`. -- @param buffer The global buffer. -- @param line The line number in *buffer* to get the length of. -- @return number function line_length(buffer, line) end --- -- Scroll right *columns* columns and down *lines* lines. -- Negative values are allowed. -- @param buffer The global buffer. -- @param columns The number of columns to scroll horizontally. -- @param lines The number of lines to scroll vertically. function line_scroll(buffer, columns, lines) end --- -- Scroll the buffer down one line, keeping the caret visible. -- @param buffer The global buffer. function line_scroll_down(buffer) end --- -- Scroll the buffer up one line, keeping the caret visible. -- @param buffer The global buffer. function line_scroll_up(buffer) end --- -- Switches the current line with the previous one. -- @param buffer The global buffer. function line_transpose(buffer) end --- -- Moves the caret up one line. -- @param buffer The global buffer. function line_up(buffer) end --- -- Moves the caret up one line, extending the selected text to the new position. -- @param buffer The global buffer. function line_up_extend(buffer) end --- -- Moves the caret up one line, extending the rectangular selection to the new -- position. -- @param buffer The global buffer. function line_up_rect_extend(buffer) end --- -- Joins the lines in the target range, inserting spaces between joined -- words at line boundaries. -- @param buffer The global buffer. function lines_join(buffer) end --- -- Splits the lines in the target range into lines at most *width* pixels wide, -- or if *width* is `0`, lines as wide as the view. -- @param buffer The global buffer. -- @param width The pixel width to split lines at. When `0`, uses the width of -- the view. function lines_split(buffer, pixel_width) end --- -- Converts the selected text to lower case letters. -- @param buffer The global buffer. function lower_case(buffer) end --- -- Clears margin text on all lines. -- @param buffer The global buffer. function margin_text_clear_all(buffer) end --- -- Adds marker number *marker_num*, in the range of `0` to `31`, to 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. -- @param buffer The global buffer. -- @param line The line number to add the marker on. -- @param marker_num The marker number in the range of `0` to `31` to add. -- @return number function marker_add(buffer, line, marker_num) end --- -- Adds the markers specified in the marker bit-mask *marker_mask* to line -- number *line*. -- The first bit is set to add marker number 0, the second bit for marker number -- 1, and so on up to marker number 31. -- @param buffer The global buffer. -- @param line The line number to add the markers on. -- @param marker_mask The mask of markers to set. Set bit 0 to set marker 0, bit -- 1 for marker 1 and so on. function marker_add_set(buffer, line, marker_mask) end --- -- Associates marker number *marker_num*, in the range of `0` to `31`, with -- symbol *marker_symbol*. -- *marker_symbol* is shown in symbol margins next to lines marked with -- *marker_num*. -- @param buffer The global buffer. -- @param marker_num The marker number in the range of `0` to `31` to set -- *marker_symbol* for. -- @param marker_symbol The marker symbol: `buffer.MARK_*`. -- @see _SCINTILLA.next_marker_number function marker_define(buffer, marker_num, marker_symbol) end --- -- Associates marker number *marker_num*, in the range of `0` to `31`, with XPM -- image *pixmap*. -- The `buffer.MARK_PIXMAP` symbol must be associated with *marker_num*. -- The image is shown in symbol margins next to lines marked with *marker_num*. -- @param buffer The global buffer. -- @param marker_num The marker number in the range of `0` to `31` to define -- pixmap *pixmap* for. -- @param pixmap The string pixmap data. function marker_define_pixmap(buffer, marker_num, pixmap) end --- -- Associates marker number *marker_num*, in the range of `0` to `31`, with RGBA -- image *pixels*. -- The dimensions for *pixels*, `buffer.rgba_image_width` and -- `buffer.rgba_image_height`, must have already been 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. -- The `buffer.MARK_RGBAIMAGE` symbol must be associated with *marker_num*. -- The image is shown in symbol margins next to lines marked with *marker_num*. -- RGBA image markers use the `buffer.MARK_RGBAIMAGE` marker symbol. -- @param buffer The global buffer. -- @param marker_num The marker number in the range of `0` to `31` to define -- RGBA data *pixels* for. -- @param 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]`. function marker_define_rgba_image(buffer, marker_num, pixels) end --- -- Deletes marker number *marker_num*, in the range of `0` to `31` or `-1` for -- all markers, from line number *line*. -- @param buffer The global buffer. -- @param line The line number to delete the marker on. -- @param 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. function marker_delete(buffer, line, marker_num) end --- -- Deletes marker number *marker_num*, in the range of `0` to `31`, from any -- line that has it. -- If *marker_num* is `-1`, deletes all markers from all lines. -- @param buffer The global buffer. -- @param 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. function marker_delete_all(buffer, marker_num) end --- -- Deletes the marker with handle *handle* returned by `buffer:marker_add()`. -- @param buffer The global buffer. -- @param handle The identifier of a marker returned by `buffer:marker_add()`. function marker_delete_handle(buffer, handle) end --- -- Highlights the margin fold markers for the current fold block if *enabled* is -- `true`. -- @param buffer The global buffer. -- @param enabled Whether or not to enable highlight. function marker_enable_highlight(buffer, enabled) end --- -- Returns a bit-mask representing the markers that were added to line number -- *line*. -- The first bit is set if marker number 0 is present, the second bit for marker -- number 1, and so on. -- @param buffer The global buffer. -- @param line The line number to get markers on. -- @return number function marker_get(buffer, line) end --- -- Returns the line number that marker handle *handle*, returned by -- `buffer:marker_add()`, was added to, or `-1`. -- @param buffer The global buffer. -- @param handle The identifier of a marker returned by `buffer:marker_add()`. -- @return number function marker_line_from_handle(buffer, handle) end --- -- Returns the first line number starting at line number *start_line* that has -- had all of the markers represented by marker bit-mask *marker_mask* added to -- it, or `-1` if no line was found. -- Bit 0 is set if marker 0 is set, bit 1 for marker 1, etc., up to marker 31. -- @param buffer The global buffer. -- @param start_line The start line to search from. -- @param 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 function marker_next(buffer, start_line, marker_mask) end --- -- Returns the last line number before or on line number *start_line* that has -- had all of the markers represented by marker bit-mask *marker_mask* added to -- it, or `-1` if no line was found. -- Bit 0 is set if marker 0 is set, bit 1 for marker 1, etc., up to marker 31. -- @param buffer The global buffer. -- @param start_line The start line to search from. -- @param 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 function marker_previous(buffer, start_line, marker_mask) end --- -- 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()`. -- @param buffer The global buffer. -- @param marker_num The marker number in the range of `0` to `31` to get the -- symbol of. -- @return number function marker_symbol_defined(buffer, marker_num) end --- -- Moves the caret into view if it is not already, removing any selections. -- @param buffer The global buffer. function move_caret_inside_view(buffer) end --- -- Moves the selected lines down one line. -- @param buffer The global buffer. function move_selected_lines_down(buffer) end --- -- Moves the selected lines up one line. -- @param buffer The global buffer. function move_selected_lines_up(buffer) end --- -- Types a new line at the caret position based on -- [`buffer.eol_mode`](#eol_mode). -- @param buffer The global buffer. function new_line(buffer) end --- -- Moves the caret down one page. -- @param buffer The global buffer. function page_down(buffer) end --- -- Moves the caret down one page, extending the selected text to the new -- position. -- @param buffer The global buffer. function page_down_extend(buffer) end --- -- Moves the caret down one page, extending the rectangular selection to the new -- position. -- @param buffer The global buffer. function page_down_rect_extend(buffer) end --- -- Moves the caret up one page. -- @param buffer The global buffer. function page_up(buffer) end --- -- Moves the caret up one page, extending the selected text to the new position. -- @param buffer The global buffer. function page_up_extend(buffer) end --- -- Moves the caret up one page, extending the rectangular selection to the new -- position. -- @param buffer The global buffer. function page_up_rect_extend(buffer) end --- -- Moves the caret down one paragraph. -- Paragraphs are surrounded by one or more blank lines. -- @param buffer The global buffer. function para_down(buffer) end --- -- Moves the caret down one paragraph, extending the selected text to the new -- position. -- Paragraphs are surrounded by one or more blank lines. -- @param buffer The global buffer. function para_down_extend(buffer) end --- -- Moves the caret up one paragraph. -- Paragraphs are surrounded by one or more blank lines. -- @param buffer The global buffer. function para_up(buffer) end --- -- Moves the caret up one paragraph, extending the selected text to the new -- position. -- Paragraphs are surrounded by one or more blank lines. -- @param buffer The global buffer. function para_up_extend(buffer) end --- -- Pastes the contents of the clipboard into the buffer, replacing any selected -- text depending on `buffer.multi_paste`. -- @param buffer The global buffer. function paste(buffer) end --- -- Returns the x-coordinate in the view of position *pos*. -- @param buffer The global buffer. -- @param pos The position in *buffer* to get the x-coordinate in the view of. -- @return number function point_x_from_position(buffer, pos) end --- -- Returns the y-coordinate in the view of position *pos*. -- @param buffer The global buffer. -- @param pos The position in *buffer* to get the y-coordinate in the view of. -- @return number function point_y_from_position(buffer, pos) end --- -- Returns the position of the next character after position *pos*, taking -- multi-byte characters into account, or `buffer.length - 1`. -- @param buffer The global buffer. -- @param pos The position in *buffer* to get the position after from. function position_after(buffer, pos) end --- -- Returns the position of the previous character before position *pos*, taking -- multi-byte characters into account, or `0`. -- @param buffer The global buffer. -- @param pos The position in *buffer* to get the position before from. -- @return number function position_before(buffer, pos) end --- -- Returns the position at the beginning of line number *line*. -- Returns `-1` if *line* is greater than `buffer.line_count`. -- @param buffer The global buffer. -- @param line The line number in *buffer* to get the beginning position for. -- @return number function position_from_line(buffer, line) end --- -- Redoes the next undone action. -- @param buffer The global buffer. function redo(buffer) end --- -- Registers XPM image *xpm_data* to type number *type* for use in -- autocompletion lists. -- @param buffer The global buffer. -- @param type Integer type to register the image with. -- @param xpm_data The XPM data as described in `buffer:marker_define_pixmap()`. function register_image(buffer, type, xpm_data) end --- -- 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 have already been 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. -- @param buffer The global buffer. -- @param type Integer type to register the image with. -- @param pixels The RGBA data as described in -- `buffer:marker_define_rgba_image()`. function register_rgba_image(buffer, type, pixels) end --- -- Releases all styles allocated with `buffer:allocate_extended_styles()`. -- @param buffer The global buffer. -- @see allocate_extended_styles function release_all_extended_styles(buffer) end --- -- Replaces the selected text with string *text*, scrolling the caret into view. -- @param buffer The global buffer. -- @param text The text to replace the selected text with. function replace_sel(buffer, text) end --- -- Replaces the text in the target range with string *text* without modifying -- any selections or scrolling the view. -- Setting the target and calling this function with an empty string is another -- way to delete text. -- @param buffer The global buffer. -- @param text The text to replace the target range with. -- @return number function replace_target(buffer, text) end --- -- Replaces the text in the target range with string *text* but first replaces -- any "\d" sequences with the value of tag match number *d* from the regular -- expression (or the entire match for *d* = 0), and then returns the length of -- the replacement text. -- @param buffer The global buffer. -- @param text The text to replace the target range with. -- @return number function replace_target_re(buffer, text) end --- -- Sets the next additional selection to be the main selection. -- @param buffer The global buffer. function rotate_selection(buffer) end --- -- Scrolls the caret into view based on the policies set with -- `buffer:set_x_caret_policy()` and `buffer:set_y_caret_policy()`. -- @param buffer The global buffer. -- @see set_x_caret_policy -- @see set_y_caret_policy function scroll_caret(buffer) end --- -- Scrolls the range of text between positions *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. -- @param buffer The global buffer. -- @param secondary_pos The secondary range position to scroll into view. -- @param primary_pos The primary range position to scroll into view. function scroll_range(buffer, secondary_pos, primary_pos) end --- -- Scrolls to the end of the buffer without moving the caret. -- @param buffer The global buffer. function scroll_to_end(buffer) end --- -- Scrolls to the beginning of the buffer without moving the caret. -- @param buffer The global buffer. function scroll_to_start(buffer) end --- -- Sets the position `buffer:search_next()` and `buffer:search_prev()` begin at -- to the caret position. -- @param buffer The global buffer. function search_anchor(buffer) end --- -- 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. -- @param buffer The global buffer. -- @param text The text to search the target range for. -- @return number -- @see search_flags function search_in_target(buffer, text) end --- -- 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. -- @param buffer The global buffer. -- @param flags The search flags to use. See `buffer.search_flags`. -- @param text The text to search for. -- @return number -- @see search_flags function search_next(buffer, flags, text) end --- -- 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`. -- @param buffer The global buffer. -- @param flags The search flags to use. See `buffer.search_flags`. -- @param text The text to search for. -- @return number -- @see search_flags function search_prev(buffer, flags, text) end --- -- Selects all of the buffer's text without scrolling the view. -- @param buffer The global buffer. function select_all(buffer) end --- -- Duplicates the selected text to its right or the current line on a new line -- below. -- @param buffer The global buffer. function selection_duplicate(buffer) end --- -- Resets `buffer.word_chars`, `buffer.whitespace_chars`, and -- `buffer.punctuation_chars` to their respective defaults. -- @param buffer The global buffer. -- @see word_chars -- @see whitespace_chars -- @see punctuation_chars function set_chars_default(buffer) end --- -- Moves the caret to position *pos* without scrolling the view and removes any -- selections. -- @param buffer The buffer -- @param pos The position in *buffer* to move to. function set_empty_selection(buffer, pos) end --- -- Overrides the default color of the fold margin with *color*, in "0xBBGGRR" -- format, if *use_setting* is `true`. -- @param buffer The global buffer. -- @param use_setting Whether or not to use *color*. -- @param color The color in "0xBBGGRR" format. function set_fold_margin_colour(buffer, use_setting, color) end --- -- Overrides the default highlight color of the fold margin with *color*, in -- "0xBBGGRR" format, if *use_setting* is `true`. -- @param buffer The global buffer. -- @param use_setting Whether or not to use *color*. -- @param color The color in "0xBBGGRR" format. function set_fold_margin_hi_colour(buffer, use_setting, color) end --- -- Overrides the default background color of active hotspots with *color*, in -- "0xBBGGRR" format, if *use_setting* is `true`. -- @param buffer The global buffer. -- @param use_setting Whether or not to use *color*. -- @param color The color in "0xBBGGRR" format. function set_hotspot_active_back(buffer, use_setting, color) end --- -- Overrides the default foreground color of active hotspots with *color*, in -- "0xBBGGRR" format, if *use_setting* is `true`. -- @param buffer The global buffer. -- @param use_setting Whether or not to use *color*. -- @param color The color in "0xBBGGRR" format. function set_hotspot_active_fore(buffer, use_setting, color) end --- -- Indicates the buffer has no unsaved changes. -- @param buffer The global buffer. function set_save_point(buffer) end --- -- Selects the buffer's text between positions *start_pos* and *end_pos*, -- scrolling the selected text into view. -- @param buffer The global buffer. -- @param start_pos The start position of the range of text in *buffer* to -- select. If negative, it means the end of the buffer. -- @param 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`). function set_sel(buffer, start_pos, end_pos) end --- -- Overrides the default background color of the selection with *color*, in -- "0xBBGGRR" format, if *use_setting* is `true`. -- @param buffer The global buffer. -- @param use_setting Whether or not to use *color*. -- @param color The color in "0xBBGGRR" format. function set_sel_back(buffer, use_setting, color) end --- -- Overrides the default foreground color of the selection with *color*, in -- "0xBBGGRR" format, if *use_setting* is `true`. -- @param buffer The global buffer. -- @param use_setting Whether or not to use *color*. -- @param color The color in "0xBBGGRR" format. function set_sel_fore(buffer, use_setting, color) end --- -- Selects the buffer's text between positions *start_pos* to *end_pos*, -- removing all other selections. -- @param buffer The global buffer. -- @param end_pos The caret position of the range of text to select in *buffer*. -- @param start_pos The anchor position of the range of text to select in -- *buffer*. function set_selection(buffer, end_pos, start_pos) end --- -- 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*. -- @param buffer The global buffer. -- @param length The number of characters to style. -- @param style The style number to set. function set_styling(buffer, length, style) end --- -- Replaces the buffer's text with string *text*. -- @param buffer The global buffer. -- @param text The text to set. function set_text(buffer, text) end --- -- 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()`. -- @param buffer The global buffer. -- @param visible_policy The combination of `buffer.VISIBLE_SLOP` and -- `buffer.VISIBLE_STRICT` policy flags to set. -- @param visible_slop The slop value to use. function set_visible_policy(buffer, visible_policy, visible_slop) end --- -- Overrides the background color of whitespace with *color*, in "0xBBGGRR" -- format, if *use_setting* is `true`. -- @param buffer The global buffer. -- @param use_setting Whether or not to use *color*. -- @param color The color in "0xBBGGRR" format. function set_whitespace_back(buffer, use_setting, color) end --- -- Overrides the foreground color of whitespace with *color*, in "0xBBGGRR" -- format, if *use_setting* is `true`. -- @param use_setting Whether or not to use *color*. -- @param color The color in "0xBBGGRR" format. function set_whitespace_fore(buffer, use_setting, color) end --- -- Set the way the caret is kept visible when going sideways. -- The exclusion zone is given in pixels. -- @param buffer The global buffer. -- @param caret_policy The combination of `buffer.CARET_SLOP`, -- `buffer.CARET_STRICT`, `buffer.CARET_EVEN`, and `buffer.CARET_JUMPS` policy -- flags to set. -- @param caret_slop The slop value to use. function set_x_caret_policy(buffer, caret_policy, caret_slop) end --- -- Set the way the line the caret is on is kept visible. -- @param buffer The global buffer. -- @param caret_policy The combination of `buffer.CARET_SLOP`, -- `buffer.CARET_STRICT`, `buffer.CARET_EVEN`, and `buffer.CARET_JUMPS` policy -- flags to set. -- @param caret_slop The slop value to use. function set_y_caret_policy(buffer, caret_policy, caret_slop) end --- -- 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. -- @param buffer The global buffer. -- @param start_line The start line of the range of lines in *buffer* to show. -- @param end_line The end line of the range of lines in *buffer* to show. function show_lines(buffer, start_line, end_line) end --- -- Begin styling at position *position* with styling bit-mask *styling_mask*. -- *styling_mask* specifies which style bits can be set with -- `buffer:set_styling()`. -- @param buffer The global buffer. -- @param position The position in *buffer* to start styling at. -- @param styling_mask The bit mask of style bits that can be set when styling. -- @usage buffer:start_styling(0, 0xFF) function start_styling(buffer, position, style_mask) end --- -- Moves the caret to the bottom of the page, or if already there, down one -- page. -- @param buffer The global buffer. function stuttered_page_down(buffer) end --- -- Like `buffer:stuttered_page_down()`, but extends the selected text to the new -- position. -- @param buffer The global buffer. function stuttered_page_down_extend(buffer) end --- -- Moves the caret to the top of the page, or if already there, up one page. -- @param buffer The global buffer. function stuttered_page_up(buffer) end --- -- Like `buffer:stuttered_page_up()`, but extends the selected text to the new -- position. -- @param buffer The global buffer. function stuttered_page_up_extend(buffer) end --- -- Sets all styles to have the same properties as -- `buffer.STYLE_DEFAULT`. -- @param buffer The global buffer. function style_clear_all(buffer) end --- -- Resets `buffer.STYLE_DEFAULT` to its initial state. -- @param buffer The global buffer. function style_reset_default(buffer) end --- -- Swaps the beginning and end positions of the main selection. -- @param buffer The global buffer. function swap_main_anchor_caret(buffer) end --- -- Indents the text on the selected lines or types a Tab character ("\t") at -- the caret position. -- @param buffer The global buffer. function tab(buffer) end --- -- Sets the beginning and end positions of the target range to be the beginning -- and end positions of the main selection. -- @param buffer The global buffer. function target_from_selection(buffer) end --- -- Returns the pixel height of line number *line*. -- @param buffer The global buffer. -- @param line The line number in *buffer* to get the pixel height of. -- @return number function text_height(buffer, line) end --- -- Returns the pixel width of string *text* styled with style number -- *style_num*, in the range of `0` to `255`. -- @param buffer The global buffer. -- @param style_num The style number between `0` and `255` to use. -- @param text The text to measure the width of. -- @return number function text_width(buffer, style_num, text) end --- -- Cycles between caret sticky option settings `buffer.CARETSTICKY_ON`, -- `buffer.CARETSTICKY_WHITESPACE`, and `buffer.CARETSTICKY_OFF`. -- @param buffer The global buffer. -- @see caret_sticky function toggle_caret_sticky(buffer) end --- -- Toggles the fold state of the fold header on line number *line* between -- expanded, where all of its child lines are displayed, and contracted, where -- all of its child lines are hidden. -- @param buffer The global buffer. -- @param line The line number in *buffer* to toggle the fold on. function toggle_fold(buffer, line) end --- -- Undoes the most recent action. -- @param buffer The global buffer. function undo(buffer) end --- -- Converts the selected text to upper case letters. -- @param buffer The global buffer. function upper_case(buffer) end --- -- Displays a list identified by list identifier number *list_item* and -- constructed from string *item_list*, whose items are delimited by -- `buffer.auto_c_separator` characters. -- The sorted order of *item_list*, `buffer.auto_c_order`, must have already -- been defined. When the user selects an item, *list_type* is sent in a -- `USER_LIST_SELECTION` event along with the selection. -- @param buffer The global buffer. -- @param list_type The list identifier number greater than zero to use. -- @param item_list The sorted string of words to show, separated by -- `buffer.auto_c_separator` characters (initially spaces). -- @see _SCINTILLA.next_user_list_type function user_list_show(buffer, list_type, item_list) end --- -- Moves the caret to the first visible character on the current line, or if -- already there, to the beginning of the current line. -- @param buffer The global buffer. function vc_home(buffer) end --- -- 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. -- @param buffer The global buffer. function vc_home_display(buffer) end --- -- Like `buffer:vc_home_display()`, but extends the selected text to the new -- position. -- @param buffer The global buffer. function vc_home_display_extend(buffer) end --- -- Like `buffer:vc_home()`, but extends the selected text to the new position. -- @param buffer The global buffer. function vc_home_extend(buffer) end --- -- Like `buffer:vc_home()`, but extends the rectangular selection to the new -- position. -- @param buffer The global buffer. function vc_home_rect_extend(buffer) end --- -- Moves the caret to the first visible character on the current wrapped line, -- or if already there, to the beginning of the actual line. -- @param buffer The global buffer. function vc_home_wrap(buffer) end --- -- Like `buffer:vc_home_wrap()`, but extends the selected text to the new -- position. -- @param buffer The global buffer. function vc_home_wrap_extend(buffer) end --- -- Centers current line in the view. -- @param buffer The global buffer. function vertical_centre_caret(buffer) end --- -- 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. -- @param buffer The global buffer. -- @param line The line number in *buffer* to use. -- @return number function visible_from_doc_line(buffer, line) end --- -- 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. -- @param buffer The global buffer. -- @param pos The position in *buffer* of the word. -- @param 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. function word_end_position(buffer, pos, only_word_chars) end --- -- Moves the caret left one word. -- `buffer.word_chars` contains word characters. -- @param buffer The global buffer. function word_left(buffer) end --- -- Moves the caret left one word, positioning it at the end of the previous -- word. -- `buffer.word_chars` contains word characters. -- @param buffer The global buffer. function word_left_end(buffer) end --- -- Like `buffer:word_left_end()`, but extends the selected text to the new -- position. -- @param buffer The global buffer. function word_left_end_extend(buffer) end --- -- Moves the caret left one word, extending the selected text to the new -- position. -- `buffer.word_chars` contains word characters. -- @param buffer The global buffer. function word_left_extend(buffer) end --- -- Moves the caret to the previous underscore or change in capitalization within -- the current word. -- `buffer.word_chars` contains word characters. -- @param buffer The global buffer. function word_part_left(buffer) end --- -- Moves the caret 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. -- @param buffer The global buffer. function word_part_left_extend(buffer) end --- -- Moves the caret to the next underscore or change in capitalization within the -- current word. -- `buffer.word_chars` contains word characters. -- @param buffer The global buffer. function word_part_right(buffer) end --- -- Moves the caret 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. -- @param buffer The global buffer. function word_part_right_extend(buffer) end --- -- Moves the caret right one word. -- `buffer.word_chars` contains word characters. -- @param buffer The global buffer. function word_right(buffer) end --- -- Moves the caret right one word, positioning it at the end of the current -- word. -- `buffer.word_chars` contains word characters. -- @param buffer The global buffer. function word_right_end(buffer) end --- -- Like `buffer:word_right_end()`, but extends the selected text to the new -- position. -- @param buffer The global buffer. function word_right_end_extend(buffer) end --- -- Moves the caret right one word, extending the selected text to the new -- position. -- `buffer.word_chars` contains word characters. -- @param buffer The global buffer. function word_right_extend(buffer) end --- -- 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. -- @param buffer The global buffer. -- @param pos The position in *buffer* of the word. -- @param 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. function word_start_position(buffer, pos, only_word_chars) end --- -- Returns the number of wrapped lines needed to display line number *line*. -- @param buffer The global buffer. -- @param line The line number in *buffer* to use. -- @return number function wrap_count(buffer, line) end --- -- Increases the size of all fonts by one point, up to 20. -- @param buffer The global buffer. function zoom_in(buffer) end --- -- Decreases the size of all fonts by one point, down to -10. -- @param buffer The global buffer. function zoom_out(buffer) end -- External functions. --- -- 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. -- @param buffer The buffer to check. -- @see _G._G.buffer function check_global(buffer) end --- -- Deletes the buffer. -- **Do not call this function.** Call `buffer:close()` instead. Emits a -- `BUFFER_DELETED` event. -- @param buffer The global buffer. -- @see events.BUFFER_DELETED function delete(buffer) end --- -- Creates and returns a new buffer. -- Emits a `BUFFER_NEW` event. -- @return the new buffer. -- @class function -- @see events.BUFFER_NEW function new() end --- -- Returns the buffer's text between positions *start_pos* and *end_pos*. -- @param buffer The global buffer. -- @param start_pos The start position of the range of text to get in *buffer*. -- @param end_pos The end position of the range of text to get in *buffer*. function text_range(buffer, start_pos, end_pos) end --- -- 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`. -- @param buffer The global buffer. -- @param 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. function get_lexer(buffer, current) end --- -- Sets the name of the lexer used by the buffer to *lang* or the auto-detected -- language and then loads the appropriate language module if the module exists. -- @param buffer The global buffer. -- @param lang Optional string language name to set. If `nil`, attempts to -- auto-detect the buffer's language. -- @usage buffer.set_lexer(buffer, 'language_name') function set_lexer(buffer, lang) end -- Unused Fields. -- * annotation_styles -- * automatic_fold -- * call_tip_back -- * call_tip_fore -- * character_pointer -- * code_page -- * control_char_symbol -- * direct_function -- * direct_pointer -- * distance_to_secondary_styles+ -- * doc_pointer -- * focus -- * font_quality -- * gap_position -- * identifier -- * identifiers+ -- * indicator_value -- * keys_unicode -- * key_words -- * layout_cache -- * lexer -- * lexer_language -- * line_end_types_active+ -- * line_end_types_allowed+ -- * line_end_types_supported+ -- * margin_styles -- * mod_event_mask -- * modify -- * mouse_down_captures -- * paste_convert_endings -- * position_cache -- * print_colour_mode -- * print_magnification -- * print_wrap_mode -- * status -- * style_bits -- * style_bits_needed -- * style_character_set -- * style_size_fractional -- * style_weight -- * sub_style_bases+ -- * sub_styles_length+ -- * sub_styles_start+ -- * technology -- * use_palette -- Unused Functions. -- * add_ref_document -- * add_styled_text -- * add_undo_action -- * allocate -- * allocate_sub_styles+ -- * assign_cmd_key -- * can_paste -- * clear_cmd_key -- * clear_all_cmd_keys -- * create_document -- * create_loader -- * describe_key_word_sets -- * describe_property -- * encoded_from_utf8 -- * find_indicator_flash -- * find_indicator_hide -- * find_indicator_show -- * find_text -- * format_range -- * free_sub_styles+ -- * get_range_pointer -- * get_styled_text -- * grab_focus -- * indicator_value_at -- * load_lexer_library -- * null -- * position_from_point -- * position_from_point_close -- * private_lexer_call -- * property_names -- * property_type -- * release_document -- * set_length_for_encode -- * set_styling_ex -- * start_record -- * stop_record -- * target_as_utf8 -- * use_pop_up -- -- + provisional features