From b97bde85963486f0fb2b81c9089b784473d0505d Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 13 Dec 2011 05:44:01 -0500 Subject: Updated Lua Adeptsense. --- modules/lua/api | 226 ++++++++++++++++++++++++++----------------------- modules/lua/lua.luadoc | 6 +- modules/lua/tags | 37 +++++--- 3 files changed, 147 insertions(+), 122 deletions(-) (limited to 'modules') diff --git a/modules/lua/api b/modules/lua/api index 73b7c34d..fe5af81f 100644 --- a/modules/lua/api +++ b/modules/lua/api @@ -29,11 +29,11 @@ COMMENT lexer.COMMENT\n\n COMPILE_OUTPUT events.COMPILE_OUTPUT\nCalled after a compile command is executed. When connecting to this event\n(typically from a language-specific module), connect with an index of `1`\nand return `true` if the event was handled and you want to override the\ndefault handler that prints the output to a new view.\n * `lexer`: The lexer language.\n * `output`: The output from the command.\n\n CONSTANT lexer.CONSTANT\n\n Carg lpeg.Carg(n)\nCreates an argument capture. This pattern matches the empty string and produces\nthe value given as the nth extra argument given in the call to lpeg.match.\n -Cb lpeg.Cb(name)\nCreates a back capture. This pattern matches the empty string and produces the\nvalues produced by the most recent group capture named name. Most recent means\nthe last complete outermost group capture with the given name. A Complete\ncapture means that the entire pattern corresponding to the capture has\nmatched. An Outermost capture means that the capture is not inside another\ncomplete capture.\n +Cb lpeg.Cb(name)\nCreates a back capture. This pattern matches the empty string and produces the\nvalues produced by the most recent group capture named name. Most recent\nmeans the last complete outermost group capture with the given name. A\nComplete capture means that the entire pattern corresponding to the capture\nhas matched. An Outermost capture means that the capture is not inside\nanother complete capture.\n Cc lpeg.Cc([value, ...])\nCreates a constant capture. This pattern matches the empty string and produces\nall given values as its captured values.\n -Cf lpeg.Cf(patt, func)\nCreates a fold capture. If patt produces a list of captures C1 C2 ... Cn,\nthis capture will produce the value func(...func(func(C1, C2), C3)...,\nCn), that is, it will fold (or accumulate, or reduce) the captures from\npatt using function func. This capture assumes that patt should produce at\nleast one capture with at least one value (of any type), which becomes the\ninitial value of an accumulator. (If you need a specific initial value,\nyou may prefix a constant capture to patt.) For each subsequent capture\nLPeg calls func with this accumulator as the first argument and all values\nproduced by the capture as extra arguments; the value returned by this call\nbecomes the new value for the accumulator. The final value of the accumulator\nbecomes the captured value. As an example, the following pattern matches a\nlist of numbers separated by commas and returns their addition: -- matches\na numeral and captures its value number = lpeg.R"09"^1 / tonumber -- matches\na list of numbers, captures their values list = number * ("," * number)^0 --\nauxiliary function to add two numbers function add (acc, newvalue) return acc\n+ newvalue end -- folds the list of numbers adding them sum = lpeg.Cf(list,\nadd) -- example of use print(sum:match("10,30,43")) --> 83\n -Cg lpeg.Cg(patt [, name])\nCreates a group capture. It groups all values returned by patt into a single\ncapture. The group may be anonymous (if no name is given) or named with the\ngiven name. An anonymous group serves to join values from several captures into\na single capture. A named group has a different behavior. In most situations,\na named group returns no values at all. Its values are only relevant for a\nfollowing back capture or when used inside a table capture.\n -Cmt lpeg.Cmt(patt, function)\nCreates a match-time capture. Unlike all other captures, this one is evaluated\nimmediately when a match occurs. It forces the immediate evaluation of all its\nnested captures and then calls function. The given function gets as arguments\nthe entire subject, the current position (after the match of patt), plus any\ncapture values produced by patt. The first value returned by function defines\nhow the match happens. If the call returns a number, the match succeeds and\nthe returned number becomes the new current position. (Assuming a subject s\nand current position i, the returned number must be in the range [i, len(s)\n+ 1].) If the call returns true, the match succeeds without consuming any\ninput. (So, to return true is equivalent to return i.) If the call returns\nfalse, nil, or no value, the match fails. Any extra values returned by the\nfunction become the values produced by the capture.\n +Cf lpeg.Cf(patt, func)\nCreates a fold capture. If patt produces a list of captures C1 C2 ... Cn,\nthis capture will produce the value func(...func(func(C1, C2), C3)..., Cn),\nthat is, it will fold (or accumulate, or reduce) the captures from patt using\nfunction func. This capture assumes that patt should produce at least one\ncapture with at least one value (of any type), which becomes the initial\nvalue of an accumulator. (If you need a specific initial value, you may\nprefix a constant capture to patt.) For each subsequent capture LPeg calls\nfunc with this accumulator as the first argument and all values produced by\nthe capture as extra arguments; the value returned by this call becomes the\nnew value for the accumulator. The final value of the accumulator becomes\nthe captured value. As an example, the following pattern matches a list\nof numbers separated by commas and returns their addition: -- matches a\nnumeral and captures its value number = lpeg.R"09"^1 / tonumber -- matches\na list of numbers, captures their values list = number * ("," * number)^0 --\nauxiliary function to add two numbers function add (acc, newvalue) return acc\n+ newvalue end -- folds the list of numbers adding them sum = lpeg.Cf(list,\nadd) -- example of use print(sum:match("10,30,43")) --> 83\n +Cg lpeg.Cg(patt [, name])\nCreates a group capture. It groups all values returned by patt into a\nsingle capture. The group may be anonymous (if no name is given) or named\nwith the given name. An anonymous group serves to join values from several\ncaptures into a single capture. A named group has a different behavior. In\nmost situations, a named group returns no values at all. Its values are only\nrelevant for a following back capture or when used inside a table capture.\n +Cmt lpeg.Cmt(patt, function)\nCreates a match-time capture. Unlike all other captures, this one is evaluated\nimmediately when a match occurs. It forces the immediate evaluation of all its\nnested captures and then calls function. The given function gets as arguments\nthe entire subject, the current position (after the match of patt), plus any\ncapture values produced by patt. The first value returned by function defines\nhow the match happens. If the call returns a number, the match succeeds and\nthe returned number becomes the new current position. (Assuming a subject s\nand current position i, the returned number must be in the range [i, len(s)\n+ 1].) If the call returns true, the match succeeds without consuming any\ninput. (So, to return true is equivalent to return i.) If the call returns\nfalse, nil, or no value, the match fails. Any extra values returned by the\nfunction become the values produced by the capture.\n Cp lpeg.Cp()\nCreates a position capture. It matches the empty string and captures the\nposition in the subject where the match occurs. The captured value is a number.\n Cs lpeg.Cs(patt)\nCreates a substitution capture, which captures the substring of the subject\nthat matches patt, with substitutions. For any capture inside patt with\na value, the substring that matched the capture is replaced by the capture\nvalue (which should be a string). The final captured value is the string\nresulting from all replacements.\n Ct lpeg.Ct(patt)\nCreates a table capture. This capture creates a table and puts all values\nfrom all anonymous captures made by patt inside this table in successive\ninteger keys, starting at 1. Moreover, for each named capture group created\nby patt, the first value of the group is put into the table with the group\nname as its key. The captured value is only the table.\n @@ -106,7 +106,7 @@ P lpeg.P(value)\nConverts the given value into a proper pattern, according to th PATHS _m.textadept.snapopen.PATHS [table]\nTable of default UTF-8 paths to search.\n PREPROCESSOR lexer.PREPROCESSOR\n\n QUIT events.QUIT\nCalled when quitting Textadept. When connecting to this event, connect with\nan index of 1 or the handler will be ignored.\n -R lpeg.R({range})\nReturns a pattern that matches any single character belonging to one of\nthe given ranges. Each range is a string xy of length 2, representing all\ncharacters with code between the codes of x and y (both inclusive). As an\nexample, the pattern lpeg.R("09") matches any digit, and lpeg.R("az", "AZ")\nmatches any ASCII letter.\n +R lpeg.R({range})\nReturns a pattern that matches any single character belonging to one of\nthe given ranges. Each range is a string xy of length 2, representing all\ncharacters with code between the codes of x and y (both inclusive). As an\nexample, the pattern lpeg.R("09") matches any digit, and lpeg.R("az", "AZ")\nmatches any ASCII letter.\n REGEX lexer.REGEX\n\n REPLACE events.REPLACE\nCalled to replace selected (found) text.\n * `text`: The text to replace selected text with.\n\n REPLACE_ALL events.REPLACE_ALL\nCalled to replace all occurances of found text.\n * `find_text`: The text to search for.\n * `repl_text`: The text to replace found text with.\n\n @@ -114,7 +114,7 @@ RESETTING _G.RESETTING [bool]\nIf `reset()` has been called, this flag is `true` RESET_AFTER events.RESET_AFTER\nCalled after resetting the Lua state. This is triggered by `reset()`.\n RESET_BEFORE events.RESET_BEFORE\nCalled before resetting the Lua state. This is triggered by `reset()`.\n RUN_OUTPUT events.RUN_OUTPUT\nCalled after a run command is executed. When connecting to this event\n(typically from a language-specific module), connect with an index of `1`\nand return `true` if the event was handled and you want to override the\ndefault handler that prints the output to a new view.\n * `lexer`: The lexer language.\n * `output`: The output from the command.\n\n -S lpeg.S(string)\nReturns a pattern that matches any single character that appears in the given\nstring. (The S stands for Set.) As an example, the pattern lpeg.S("+-*/")\nmatches any arithmetic operator. Note that, if s is a character (that is,\na string of length 1), then lpeg.P(s) is equivalent to lpeg.S(s) which is\nequivalent to lpeg.R(s..s). Note also that both lpeg.S("") and lpeg.R()\nare patterns that always fail.\n +S lpeg.S(string)\nReturns a pattern that matches any single character that appears in the given\nstring. (The S stands for Set.) As an example, the pattern lpeg.S("+-*/")\nmatches any arithmetic operator. Note that, if s is a character (that is,\na string of length 1), then lpeg.P(s) is equivalent to lpeg.S(s) which is\nequivalent to lpeg.R(s..s). Note also that both lpeg.S("") and lpeg.R()\nare patterns that always fail.\n SAVE_ON_QUIT _m.textadept.session.SAVE_ON_QUIT [bool]\nSave the session when quitting. The default value is `true` and can be\ndisabled by passing the command line switch `-n` or `--nosession` to Textadept.\n SAVE_POINT_LEFT events.SAVE_POINT_LEFT\nCalled when a save point is left.\n SAVE_POINT_REACHED events.SAVE_POINT_REACHED\nCalled when a save point is entered.\n @@ -715,14 +715,14 @@ _BUFFERS _G._BUFFERS [table]\nTable of all open buffers in Textadept. Numeric ke _CHARSET _G._CHARSET [string]\nThe character set encoding of the filesystem. This is used in File I/O.\n _EMBEDDEDRULES lexer._EMBEDDEDRULES [table]\nSet of rules for an embedded lexer. For a parent lexer name, contains child's\n`start_rule`, `token_rule`, and `end_rule` patterns.\n _G _G._G [module]\nLua _G module.\n -_G _G._G\nA global variable (not a function) that holds the global environment\n(that is, `_G._G = _G`). Lua itself does not use this variable; changing\nits value does not affect any environment, nor vice-versa. (Use `setfenv`\nto change environments.)\n +_G _G._G\nA global variable (not a function) that holds the global environment (see\n§2.2). Lua itself does not use this variable; changing its value does not\naffect any environment, nor vice-versa.\n _HOME _G._HOME [string]\nPath to the directory containing Textadept.\n _LEXERPATH _G._LEXERPATH [string]\nPaths to lexers, formatted like `package.path`.\n _RELEASE _G._RELEASE [string]\nThe Textadept release version.\n _RULES lexer._RULES [table]\nList of rule names with associated LPeg patterns for a specific lexer. It\nis accessible to other lexers for embedded lexer applications.\n _SCINTILLA _G._SCINTILLA [module]\nScintilla constants, functions, and properties. Do not modify anything in\nthis module. Doing so will result in instability.\n _USERHOME _G._USERHOME [string]\nPath to the user's `~/.textadept/`.\n -_VERSION _G._VERSION\nA global variable (not a function) that holds a string containing the current\ninterpreter version. The current contents of this variable is "`Lua 5.1`".\n +_VERSION _G._VERSION [string]\nA global variable (not a function) that holds a string containing the current\ninterpreter version. The current contents of this variable is "`Lua 5.2`".\n _VIEWS _G._VIEWS [table]\nTable of all views in Textadept. Numeric keys have view values and view keys\nhave their associated numeric keys.\n _cancel_current _m.textadept.snippets._cancel_current()\nCancels the active snippet, reverting to the state before its activation,\nand restores the previously running snippet (if any).\n _insert _m.textadept.snippets._insert(text)\nInserts a snippet.\n@param text Optional snippet text. If none is specified, the snippet text\nis determined from the trigger and lexer.\n@return `false` if no snippet was expanded; `true` otherwise.\n @@ -761,12 +761,13 @@ api_files _m.textadept.adeptsense.api_files [table]\nContains a list of api file append_text buffer.append_text(buffer, text)\nAppend a string to the end of the document without changing the selection. The\ncurrent selection is not changed and the new text is not scrolled into view.\n@param buffer The global buffer.\n@param text The text.\n arg _G.arg [table]\nCommand line parameters.\n args _G.args [module]\nProcesses command line arguments for Textadept.\n +arshift bit32.arshift(x, disp)\nReturns the number `x` shifted `disp` bits to the right. The number `disp`\nmay be any representable integer. Negative displacements shift to the left.\nThis shift operation is what is called arithmetic shift. Vacant bits on the\nleft are filled with copies of the higher bit of `x`; vacant bits on the right\nare filled with zeros. In particular, displacements with absolute values higher\nthan 31 result in zero or `0xFFFFFFFF` (all original bits are shifted out).\n ascii lexer.ascii\nMatches any ASCII character (`0`..`127`).\n asin math.asin(x)\nReturns the arc sine of `x` (in radians).\n assert _G.assert(v [, message])\nIssues an error when the value of its argument `v` is false (i.e., nil or\nfalse); otherwise, returns all its arguments. `message` is an error message;\nwhen absent, it defaults to "assertion failed!"\n atan math.atan(x)\nReturns the arc tangent of `x` (in radians).\n atan2 math.atan2(y, x)\nReturns the arc tangent of `y/x` (in radians), but uses the signs of both\nparameters to find the quadrant of the result. (It also handles correctly\nthe case of `x` being zero.)\n -attributes lfs.attributes(filepath [, aname])\nReturns a table with the file attributes corresponding to filepath (or\nnil followed by an error message in case of error). If the second optional\nargument is given, then only the value of the named attribute is returned\n(this use is equivalent to lfs.attributes(filepath).aname, but the table is not\ncreated and only one attribute is retrieved from the O.S.). The attributes are\ndescribed as follows; attribute mode is a string, all the others are numbers,\nand the time related attributes use the same time reference of os.time: dev:\non Unix systems, this represents the device that the inode resides on. On\nWindows systems, represents the drive number of the disk containing the file\nino: on Unix systems, this represents the inode number. On Windows systems\nthis has no meaning mode: string representing the associated protection mode\n(the values could be file, directory, link, socket, named pipe, char device,\nblock device or other) nlink: number of hard links to the file uid: user-id\nof owner (Unix only, always 0 on Windows) gid: group-id of owner (Unix only,\nalways 0 on Windows) rdev: on Unix systems, represents the device type, for\nspecial file inodes. On Windows systems represents the same as dev access:\ntime of last access modification: time of last data modification change:\ntime of last file status change size: file size, in bytes blocks: block\nallocated for file; (Unix only) blksize: optimal file system I/O blocksize;\n(Unix only) This function uses stat internally thus if the given filepath is\na symbolic link, it is followed (if it points to another link the chain is\nfollowed recursively) and the information is about the file it refers to. To\nobtain information about the link itself, see function lfs.symlinkattributes.\n +attributes lfs.attributes(filepath [, aname])\nReturns a table with the file attributes corresponding to filepath (or\nnil followed by an error message in case of error). If the second optional\nargument is given, then only the value of the named attribute is returned\n(this use is equivalent to lfs.attributes(filepath).aname, but the table is not\ncreated and only one attribute is retrieved from the O.S.). The attributes are\ndescribed as follows; attribute mode is a string, all the others are numbers,\nand the time related attributes use the same time reference of os.time: dev:\non Unix systems, this represents the device that the inode resides on. On\nWindows systems, represents the drive number of the disk containing the file\nino: on Unix systems, this represents the inode number. On Windows systems\nthis has no meaning mode: string representing the associated protection mode\n(the values could be file, directory, link, socket, named pipe, char device,\nblock device or other) nlink: number of hard links to the file uid: user-id\nof owner (Unix only, always 0 on Windows) gid: group-id of owner (Unix only,\nalways 0 on Windows) rdev: on Unix systems, represents the device type, for\nspecial file inodes. On Windows systems represents the same as dev access:\ntime of last access modification: time of last data modification change:\ntime of last file status change size: file size, in bytes blocks: block\nallocated for file; (Unix only) blksize: optimal file system I/O blocksize;\n(Unix only) This function uses stat internally thus if the given filepath\nis a symbolic link, it is followed (if it points to another link the chain is\nfollowed recursively) and the information is about the file it refers to. To\nobtain information about the link itself, see function lfs.symlinkattributes.\n auto_c_active buffer.auto_c_active(buffer)\nIs there an auto-completion list visible?\n@return bool\n auto_c_auto_hide buffer.auto_c_auto_hide [bool]\nWhether or not autocompletion is hidden automatically when nothing matches. By\ndefault, the list is cancelled if there are no viable matches (the user has\ntyped characters that no longer match a list entry).\n auto_c_cancel buffer.auto_c_cancel(buffer)\nRemove the auto-completion list from the screen. A set of characters that\nwill cancel autocompletion can be specified with `buffer:auto_c_stops()`.\n@param buffer The global buffer.\n @@ -789,20 +790,25 @@ auto_c_type_separator buffer.auto_c_type_separator [number]\nThe auto-completion autocomplete_word _m.textadept.editing.autocomplete_word(word_chars)\nPops up an autocompletion list for the current word based on other words in\nthe document.\n@param word_chars String of chars considered to be part of words.\n@return `true` if there were completions to show; `false` otherwise.\n back_space_un_indents buffer.back_space_un_indents [bool]\nWhether a backspace pressed when caret is within indentation unindents.\n back_tab buffer.back_tab(buffer)\nDedent the selected lines.\n@param buffer The global buffer.\n +band bit32.band(...)\nReturns the bitwise "and" of its operands.\n begin_undo_action buffer.begin_undo_action(buffer)\nStart a sequence of actions that is undone and redone as a unit. May be nested.\n@param buffer The global buffer.\n +bit32 _G.bit32 [module]\nLua bit32 module.\n block_comment _m.textadept.editing.block_comment(comment)\nBlock comments or uncomments code with a given comment string.\n@param comment The comment string inserted or removed from the beginning of\neach line in the selection.\n +bnot bit32.bnot(x)\nReturns the bitwise negation of `x`. For any integer `x`, the following\nidentity holds: assert(bit32.bnot(x) == (-1 - x) % 2^32)\n boms io.boms [table]\nList of byte-order marks (BOMs).\n bookmarks _m.textadept.bookmarks [module]\nBookmarks for the textadept module.\n +bor bit32.bor(...)\nReturns the bitwise "or" of its operands.\n brace_bad_light buffer.brace_bad_light(buffer, pos)\nHighlight the character at a position indicating there is no matching brace.\n@param buffer The global buffer.\n@param pos The position or -1 to remove the highlight.\n brace_bad_light_indicator buffer.brace_bad_light_indicator(buffer, use_indicator, indic_num)\nUse specified indicator to highlight non matching brace instead of changing\nits style.\n@param buffer The global buffer.\n@param use_indicator Use an indicator.\n@param indic_num The indicator number.\n brace_highlight buffer.brace_highlight(buffer, pos1, pos2)\nHighlight the characters at two positions. If indent guides are enabled,\nthe indent that corresponds with the brace can be highlighted by\nlocating the column with `buffer.column` and highlight the indent with\n`buffer.highlight_guide`.\n@param buffer The global buffer.\n@param pos1 The first position.\n@param pos2 The second position.\n brace_highlight_indicator buffer.brace_highlight_indicator(buffer, use_indicator, indic_num)\nUse specified indicator to highlight matching braces instead of changing\ntheir style.\n@param buffer The global buffer.\n@param use_indicator Use an indicator.\n@param indic_num The indicator number.\n brace_match buffer.brace_match(buffer, pos)\nFind the position of a matching brace or `-1` if no match. The brace\ncharacters handled are `(`, `)`, `[`, `]`, `{`, `}`, `<`, and `>`. The search\nis forwards from an opening brace and backwards from a closing brace. A match\nonly occurs if the style of the matching brace is the same as the starting\nbrace or the matching brace is beyond the end of styling. Nested braces are\nhandled correctly.\n@param buffer The global buffer.\n@param pos The position.\n@return number.\n braces _m.textadept.editing.braces [table]\nHighlighted brace characters. Keys are lexer language names and values\nare tables of characters that count as brace characters. This table can be\npopulated by language-specific modules.\n +btest bit32.btest(...)\nReturns a boolean signaling whether the bitwise "and" of its operands is\ndifferent from zero.\n buffer _G.buffer [module]\nThe current buffer in the current view. It also represents the structure of\nany buffer table in `_G._BUFFER`.\n buffer view.buffer [table]\nThe buffer this view contains. (Read-only)\n buffered_draw buffer.buffered_draw [bool]\nWhether drawing is buffered. If drawing is buffered then each line of text\nis drawn into a bitmap buffer before drawing it to the screen to avoid\nflicker. The default is for drawing to be buffered. first or directly onto\nthe screen.\n -byte string.byte(s [, i [, j]])\nReturns the internal numerical codes of the characters `s[i]`, `s[i+1]`,\n···, `s[j]`. The default value for `i` is 1; the default value for `j` is\n`i`. Note that numerical codes are not necessarily portable across platforms.\n +byte string.byte(s [, i [, j]])\nReturns the internal numerical codes of the characters `s[i]`, `s[i+1]`,\n..., `s[j]`. The default value for `i` is 1; the default value for `j`\nis `i`. These indices are corrected following the same rules of function\n`string.sub`. Numerical codes are not necessarily portable across platforms.\n call_tip_active buffer.call_tip_active(buffer)\nIs there an active call tip?\n@param buffer The global buffer.\n@return bool\n call_tip_back buffer.call_tip_back [number]\nThe background color for the call tip in `0xBBGGRR` format. (Write-only)\n call_tip_cancel buffer.call_tip_cancel(buffer)\nRemove the call tip from the screen. Call tips are also removed if any\nkeyboard commands that are not compatible with editing the argument list of\na function are used.\n@param buffer The global buffer.\n @@ -827,7 +833,7 @@ caret_style buffer.caret_style [number]\nThe style of the caret to be drawn.\n caret_width buffer.caret_width [number]\nThe width of the insert mode caret in pixels. Can be `0`, `1`, `2` or `3`\npixels. The default width is 1 pixel. This setting only affects the width\nof the cursor when the cursor style is set to line caret mode, it does not\naffect the width for a block caret.\n ceil math.ceil(x)\nReturns the smallest integer larger than or equal to `x`.\n change_lexer_state buffer.change_lexer_state(buffer, start_pos, end_pos)\nIndicate that the internal state of a lexer has changed over a range and\ntherefore there may be a need to redraw.\n@param buffer The global buffer.\n@param start_pos The start position.\n@param end_pos The end position.\n -char string.char(···)\nReceives zero or more integers. Returns a string with length equal to the\nnumber of arguments, in which each character has the internal numerical\ncode equal to its corresponding argument. Note that numerical codes are not\nnecessarily portable across platforms.\n +char string.char(···)\nReceives zero or more integers. Returns a string with length equal to the\nnumber of arguments, in which each character has the internal numerical code\nequal to its corresponding argument. Numerical codes are not necessarily\nportable across platforms.\n char_at buffer.char_at [table]\nTable of character bytes at positions in the document starting at\nzero. (Read-only)\n char_left buffer.char_left(buffer)\nMove caret left one character.\n@param buffer The global buffer.\n char_left_extend buffer.char_left_extend(buffer)\nMove caret left one character extending selection to new caret position.\n@param buffer The global buffer.\n @@ -838,7 +844,7 @@ char_position_from_point_close buffer.char_position_from_point_close(buffer, x, char_right buffer.char_right(buffer)\nMove caret right one character.\n@param buffer The global buffer.\n char_right_extend buffer.char_right_extend(buffer)\nMove caret right one character extending selection to new caret position.\n@param buffer The global buffer.\n char_right_rect_extend buffer.char_right_rect_extend(buffer)\nMove caret right one character, extending rectangular selection to new\ncaret position.\n@param buffer The global buffer.\n -chdir lfs.chdir(path)\nChanges the current working directory to the given path. Returns true in\ncase of success or nil plus an error string.\n +chdir lfs.chdir(path)\nChanges the current working directory to the given path. Returns true in\ncase of success or nil plus an error string.\n check_global buffer.check_global(buffer)\nChecks whether the given buffer is the global one. If not, throws an\nerror indicating so. It is necessary to call this at the top of all buffer\nfunctions to avoid unexpected behavior since most buffer functions operate on\n`_G.buffer`, which is not necessarily the given one.\n@param buffer The buffer to check.\n choose_caret_x buffer.choose_caret_x(buffer)\nSet the last x chosen value to be the caret x position. The view remembers\nthe x value of the last position horizontally moved to explicitly by the\nuser and this value is then used when moving vertically such as by using the\nup and down keys. This function sets the current x position of the caret as\nthe remembered value.\n@param buffer The global buffer.\n class_definition _m.textadept.adeptsense.syntax.class_definition\nA Lua pattern representing the language's class definition syntax. The first\ncapture returned must be the class name. A second, optional capture contains\nthe class' superclass (if any). If no completions are found for the class\nname, completions for the superclass are shown (if any). Completions will\nnot be shown for both a class and superclass unless defined in a previously\nloaded ctags file. Also, multiple superclasses cannot be recognized by this\npattern; use a ctags file instead. Defaults to `'class%s+([%w_]+)'`.\n @@ -853,12 +859,12 @@ clear_selections buffer.clear_selections(buffer)\nClear selections to a single e clipboard_text gui.clipboard_text [string]\nThe text on the clipboard. (Read-only)\n clock os.clock()\nReturns an approximation of the amount in seconds of CPU time used by the\nprogram.\n close buffer.close(buffer)\nCloses the current buffer.\n@param buffer The global buffer. If the buffer is dirty, the user is prompted\nto continue. The buffer is not saved automatically. It must be done manually.\n -close file:close()\nCloses `file`. Note that files are automatically closed when their handles are\ngarbage collected, but that takes an unpredictable amount of time to happen.\n +close file:close()\nCloses `file`. Note that files are automatically closed when their handles are\ngarbage collected, but that takes an unpredictable amount of time to happen.\nWhen closing a file handle created with `io.popen`, `file:close` returns\nthe same values returned by `os.execute`.\n close io.close([file])\nEquivalent to `file:close()`. Without a `file`, closes the default output file.\n close_all io.close_all()\nCloses all open buffers. If any buffer is dirty, the user is prompted to\ncontinue. No buffers are saved automatically. They must be saved manually.\n@usage io.close_all()\n@return true if user did not cancel.\n cntrl lexer.cntrl\nMatches any control character (`0`..`31`).\n code_page buffer.code_page [number]\nThe code page used to interpret the bytes of the document as characters. The\n`_SCINTILLA.constants.SC_CP_UTF8` value can be used to enter Unicode mode.\n -collectgarbage _G.collectgarbage(opt [, arg])\nThis function is a generic interface to the garbage collector. It performs\ndifferent functions according to its first argument, `opt`: "stop": stops the\ngarbage collector. "restart": restarts the garbage collector. "collect":\nperforms a full garbage-collection cycle. "count": returns the total\nmemory in use by Lua (in Kbytes). "step": performs a garbage-collection\nstep. The step "size" is controlled by `arg` (larger values mean more\nsteps) in a non-specified way. If you want to control the step size you\nmust experimentally tune the value of `arg`. Returns true if the step\nfinished a collection cycle. "setpause": sets `arg` as the new value for\nthe *pause* of the collector (see §2.10). Returns the previous value for\n*pause*. "setstepmul": sets `arg` as the new value for the *step multiplier*\nof the collector (see §2.10). Returns the previous value for *step*.\n +collectgarbage _G.collectgarbage([opt [, arg]])\nThis function is a generic interface to the garbage collector. It\nperforms different functions according to its first argument, `opt`:\n"collect": performs a full garbage-collection cycle. This is the default\noption. "stop": stops automatic execution of the garbage collector. "restart":\nrestarts automatic execution of the garbage collector. "count": returns\nthe total memory in use by Lua (in Kbytes) and a second value with the\ntotal memory in bytes modulo 1024. The first value has a fractional part,\nso the following equality is always true: k, b = collectgarbage("count")\nassert(k*1024 == math.floor(k)*1024 + b) (The second result is useful\nwhen Lua is compiled with a non floating-point type for numbers.) "step":\nperforms a garbage-collection step. The step "size" is controlled by `arg`\n(larger values mean more steps) in a non-specified way. If you want to control\nthe step size you must experimentally tune the value of `arg`. Returns true\nif the step finished a collection cycle. "setpause": sets `arg` as the new\nvalue for the *pause* of the collector (see §2.5). Returns the previous\nvalue for *pause*. "setstepmul": sets `arg` as the new value for the *step\nmultiplier* of the collector (see §2.5). Returns the previous value for\n*step*. "isrunning": returns a boolean that tells whether the collector\nis running (i.e., not stopped). "generational": changes the collector to\ngenerational mode. This is an experimental feature (see §2.5). "incremental":\nchanges the collector to incremental mode. This is the default mode.\n color lexer.color(r, g, b)\nCreates a Scintilla color.\n@param r The string red component of the hexadecimal color.\n@param g The string green component of the color.\n@param b The string blue component of the color.\n@usage local red = color('FF', '00', '00')\n colors lexer.colors [table]\nTable of common colors for a theme. This table should be redefined in\neach theme.\n colourise buffer.colourise(buffer, start_pos, end_pos)\nColorise a segment of the document using the current lexing language.\n@param buffer The global buffer.\n@param start_pos The start position.\n@param end_pos The end position or `-1` to style from `start_pos` to the\nend of the document.\n @@ -870,7 +876,8 @@ compile_command _m.textadept.run.compile_command [table]\nFile extensions and th complete _m.textadept.adeptsense.complete(sense, only_fields, only_functions)\nShows an autocompletion list for the symbol behind the caret.\n@param sense The Adeptsense returned by `adeptsense.new()`.\n@param only_fields If `true`, returns list of only fields; defaults to `false`.\n@param only_functions If `true`, returns list of only functions; defaults to\n`false1.\n@return `true` on success or `false`.\n@see get_symbol\n@see get_completions\n complete_symbol _m.textadept.adeptsense.complete_symbol()\nCompletes the symbol at the current position based on the current lexer's\nAdeptsense. This should be called by key commands and menus instead of\n`complete()`.\n completions _m.textadept.adeptsense.completions [table]\nContains lists of possible completions for known symbols. Each symbol key\nhas a table value that contains a list of field completions with a `fields`\nkey and a list of functions completions with a `functions` key. This table\nis normally populated by `load_ctags()`, but can also be set by the user.\n -concat table.concat(table [, sep [, i [, j]]])\nGiven an array where all elements are strings or numbers, returns\n`table[i]..sep..table[i+1] ··· sep..table[j]`. The default value for `sep`\nis the empty string, the default for `i` is 1, and the default for `j` is\nthe length of the table. If `i` is greater than `j`, returns the empty string.\n +concat table.concat(list [, sep [, i [, j]]])\nGiven a list where all elements are strings or numbers, returns\n`list[i]..sep..list[i+1] ··· sep..list[j]`. The default value for `sep`\nis the empty string, the default for `i` is 1, and the default for `j` is\n`#list`. If `i` is greater than `j`, returns the empty string.\n +config package.config\nA string describing some compile-time configurations for packages. This\nstring is a sequence of lines:\n The first line is the directory separator string. Default is '`\`' for\n Windows and '`/`' for all other systems.\n The second line is the character that separates templates in a path.\n Default is '`;`'.\n The third line is the string that marks the substitution points in a\n template. Default is '`?`'.\n The fourth line is a string that, in a path in Windows, is replaced by\n the executable's directory. Default is '`!`'.\n The fifth line is a mark to ignore all text before it when building the\n `luaopen_` function name. Default is '`-`'.\n\n connect events.connect(event, f, index)\nAdds a handler function to an event.\n@param event The string event name. It is arbitrary and need not be defined\nanywhere.\n@param f The Lua function to add.\n@param index Optional index to insert the handler into.\n@return Index of handler.\n@see disconnect\n constants _SCINTILLA.constants [table]\nScintilla constants.\n context_menu _m.textadept.menu.context_menu [table]\nContains the default right-click context menu.\n @@ -888,7 +895,7 @@ copy_text buffer.copy_text(buffer, text)\nCopy argument text to the clipboard.\n coroutine _G.coroutine [module]\nLua coroutine module.\n cos math.cos(x)\nReturns the cosine of `x` (assumed to be in radians).\n cosh math.cosh(x)\nReturns the hyperbolic cosine of `x`.\n -cpath package.cpath\nThe path used by `require` to search for a C loader. Lua initializes the C path\n`package.cpath` in the same way it initializes the Lua path `package.path`,\nusing the environment variable `LUA_CPATH` or a default path defined in\n`luaconf.h`.\n +cpath package.cpath\nThe path used by `require` to search for a C loader. Lua initializes the C path\n`package.cpath` in the same way it initializes the Lua path `package.path`,\nusing the environment variable `LUA_CPATH_5_2` or the environment variable\n`LUA_CPATH` or a default path defined in `luaconf.h`.\n cpp _G.keys.cpp [table]\nContainer for C/C++-specific key commands.\n cpp _G.snippets.cpp [table]\nContainer for C/C++-specific snippets.\n cpp _m.cpp [module]\nThe cpp module. It provides utilities for editing C/C++ code. User tags\nare loaded from _USERHOME/modules/cpp/tags and user apis are loaded from\n_USERHOME/modules/cpp/api.\n @@ -902,9 +909,9 @@ current_word _m.textadept.editing.current_word(action)\nSelects the current word currentdir lfs.currentdir()\nReturns a string with the current working directory or nil plus an error\nstring.\n cursor buffer.cursor [number]\nThe cursor type.\n * `_SCINTILLA.constants.SC_CURSORNORMAL` (-1): The normal cursor is\n displayed.\n * `_SCINTILLA.constants.SC_CURSORWAIT` (4): The wait cursor is\n displayed when the mouse is over the view.\n\n cut buffer.cut(buffer)\nCut the selection to the clipboard.\n@param buffer The global buffer.\n -date os.date([format [, time]])\nReturns a string or a table containing date and time, formatted according to\nthe given string `format`. If the `time` argument is present, this is the\ntime to be formatted (see the `os.time` function for a description of this\nvalue). Otherwise, `date` formats the current time. If `format` starts with\n'`!`', then the date is formatted in Coordinated Universal Time. After\nthis optional character, if `format` is the string "`*t`", then `date`\nreturns a table with the following fields: `year` (four digits), `month`\n(1--12), `day` (1--31), `hour` (0--23), `min` (0--59), `sec` (0--61), `wday`\n(weekday, Sunday is 1), `yday` (day of the year), and `isdst` (daylight\nsaving flag, a boolean). If `format` is not "`*t`", then `date` returns the\ndate as a string, formatted according to the same rules as the C function\n`strftime`. When called without arguments, `date` returns a reasonable date\nand time representation that depends on the host system and on the current\nlocale (that is, `os.date()` is equivalent to `os.date("%c")`).\n +date os.date([format [, time]])\nReturns a string or a table containing date and time, formatted according\nto the given string `format`. If the `time` argument is present, this is\nthe time to be formatted (see the `os.time` function for a description of\nthis value). Otherwise, `date` formats the current time. If `format` starts\nwith '`!`', then the date is formatted in Coordinated Universal Time. After\nthis optional character, if `format` is the string "`*t`", then `date`\nreturns a table with the following fields: `year` (four digits), `month`\n(1-12), `day` (1-31), `hour` (0-23), `min` (0-59), `sec` (0-61), `wday`\n(weekday, Sunday is 1), `yday` (day of the year), and `isdst` (daylight\nsaving flag, a boolean). This last field may be absent if the information is\nnot available. If `format` is not "`*t`", then `date` returns the date as a\nstring, formatted according to the same rules as the C function `strftime`.\nWhen called without arguments, `date` returns a reasonable date and time\nrepresentation that depends on the host system and on the current locale\n(that is, `os.date()` is equivalent to `os.date("%c")`). On some systems,\nthis function may be not thread safe.\n debug _G.debug [module]\nLua debug module.\n -debug debug.debug()\nEnters an interactive mode with the user, running each string that the user\nenters. Using simple commands and other debug facilities, the user can inspect\nglobal and local variables, change their values, evaluate expressions, and so\non. A line containing only the word `cont` finishes this function, so that\nthe caller continues its execution. Note that commands for `debug.debug`\nare not lexically nested within any function, and so have no direct access\nto local variables.\n +debug debug.debug()\nEnters an interactive mode with the user, running each string that the user\nenters. Using simple commands and other debug facilities, the user can inspect\nglobal and local variables, change their values, evaluate expressions, and so\non. A line containing only the word `cont` finishes this function, so that\nthe caller continues its execution. Note that commands for `debug.debug`\nare not lexically nested within any function and so have no direct access\nto local variables.\n dec_num lexer.dec_num\nMatches a decimal number.\n deg math.deg(x)\nReturns the angle `x` (given in radians) in degrees.\n del_line_left buffer.del_line_left(buffer)\nDelete back from the current position to the start of the line.\n@param buffer The global buffer.\n @@ -916,7 +923,7 @@ delete buffer.delete(buffer)\nDeletes the current buffer. WARNING: this function delete_back buffer.delete_back(buffer)\nDelete the selection or if no selection, the character before the caret.\n@param buffer The global buffer.\n delete_back_not_line buffer.delete_back_not_line(buffer)\nDelete the selection or if no selection, the character before the caret. Will\nnot delete the character before at the start of a line.\n delimited_range lexer.delimited_range(chars, escape, end_optional, balanced, forbidden)\nCreates an LPeg pattern that matches a range of characters delimitted by a\nspecific character(s). This can be used to match a string, parenthesis, etc.\n@param chars The character(s) that bound the matched range.\n@param escape Optional escape character. This parameter may be omitted, nil,\nor the empty string.\n@param end_optional Optional flag indicating whether or not an ending delimiter\nis optional or not. If true, the range begun by the start delimiter matches\nuntil an end delimiter or the end of the input is reached.\n@param balanced Optional flag indicating whether or not a balanced range is\nmatched, like `%b` in Lua's `string.find`. This flag only applies if `chars`\nconsists of two different characters (e.g. '()').\n@param forbidden Optional string of characters forbidden in a delimited\nrange. Each character is part of the set.\n@usage local sq_str_noescapes = delimited_range("'")\n@usage local sq_str_escapes = delimited_range("'", '\\', true)\n@usage local unbalanced_parens = delimited_range('()', '\\', true)\n@usage local balanced_parens = delimited_range('()', '\\', true, true)\n -dialog gui.dialog(kind, ...)\nDisplays a gcocoadialog of a specified type with the given string\narguments. Each argument is like a string in Lua's `arg` table. Tables of\nstrings are allowed as arguments and are expanded in place. This is useful\nfor filteredlist dialogs with many items.\n@return string gcocoadialog result.\n +dialog gui.dialog()\nDisplays a gcocoadialog of a specified type with the given string\narguments. Each argument is like a string in Lua's `arg` table. Tables of\nstrings are allowed as arguments and are expanded in place. This is useful\nfor filteredlist dialogs with many items.\n@return string gcocoadialog result.\n difftime os.difftime(t2, t1)\nReturns the number of seconds from time `t1` to time `t2`. In POSIX, Windows,\nand some other systems, this value is exactly `t2`*-*`t1`.\n digit lexer.digit\nMatches any digit (`0-9`).\n dir lfs.dir(path)\nLua iterator over the entries of a given directory. Each time the iterator\nis called with dir_obj it returns a directory entry's name as a string,\nor nil if there are no more entries. You can also iterate by calling\ndir_obj:next(), and explicitly close the directory before the iteration\nfinished with dir_obj:close(). Raises an error if path is not a directory.\n @@ -930,8 +937,8 @@ document_end buffer.document_end(buffer)\nMove caret to last position in documen document_end_extend buffer.document_end_extend(buffer)\nMove caret to last position in document extending selection to new caret\nposition.\n@param buffer The global buffer.\n document_start buffer.document_start(buffer)\nMove caret to first position in document.\n@param buffer The global buffer.\n document_start_extend buffer.document_start_extend(buffer)\nMove caret to first position in document extending selection to new caret\nposition.\n@param buffer The global buffer.\n -dofile _G.dofile(filename)\nOpens the named file and executes its contents as a Lua chunk. When called\nwithout arguments, `dofile` executes the contents of the standard input\n(`stdin`). Returns all values returned by the chunk. In case of errors,\n`dofile` propagates the error to its caller (that is, `dofile` does not run\nin protected mode).\n -dump string.dump(function)\nReturns a string containing a binary representation of the given function,\nso that a later `loadstring` on this string returns a copy of the\nfunction. `function` must be a Lua function without upvalues.\n +dofile _G.dofile([filename])\nOpens the named file and executes its contents as a Lua chunk. When called\nwithout arguments, `dofile` executes the contents of the standard input\n(`stdin`). Returns all values returned by the chunk. In case of errors,\n`dofile` propagates the error to its caller (that is, `dofile` does not run\nin protected mode).\n +dump string.dump(function)\nReturns a string containing a binary representation of the given function,\nso that a later `load` on this string returns a copy of the function (but\nwith new upvalues).\n edge_colour buffer.edge_colour [number]\nThe color used in edge indication in `0xBBGGRR` format.\n edge_column buffer.edge_column [number]\nThe column number which text should be kept within.\n edge_mode buffer.edge_mode [number]\nThe edge highlight mode.\n * `_SCINTILLA.constants.EDGE_NONE` (0): Long lines are not marked. This\n is the default state.\n * `_SCINTILLA.constants.EDGE_LINE` (1): A vertical line is drawn at the\n column number set by `buffer.edge_column`.\n * `_SCINTILLA.constants.EDGE_BACKGROUND` (2): The background color of\n characters after the column limit is changed to the color set by\n `buffer.edge_colour`.\n\n @@ -951,23 +958,24 @@ ensure_visible buffer.ensure_visible(buffer, line)\nEnsure a particular line is ensure_visible_enforce_policy buffer.ensure_visible_enforce_policy(buffer, line)\nEnsure a particular line is visible by expanding any header line hiding it. Use\nthe currently set visibility policy to determine which range to display.\n@param buffer The global buffer.\n@param line The line number.\n entry_text gui.command_entry.entry_text [string]\nThe text in the entry.\n eol_mode buffer.eol_mode [number]\nThe current end of line mode.\n * `_SCINTILLA.constants.SC_EOL_CRLF` (0): `CRLF`.\n * `_SCINTILLA.constants.SC_EOL_CR` (1): `CR`.\n * `_SCINTILLA.constants.SC_EOL_LF` (2): `LF`.\n\n -error _G.error(message [, level])\nTerminates the last protected function called and returns `message` as the\nerror message. Function `error` never returns. Usually, `error` adds some\ninformation about the error position at the beginning of the message. The\n`level` argument specifies how to get the error position. With level 1 (the\ndefault), the error position is where the `error` function was called. Level\n2 points the error to where the function that called `error` was called; and\nso on. Passing a level 0 avoids the addition of error position information\nto the message.\n +error _G.error(message [, level])\nTerminates the last protected function called and returns `message` as\nthe error message. Function `error` never returns. Usually, `error` adds\nsome information about the error position at the beginning of the message,\nif the message is a string. The `level` argument specifies how to get the\nerror position. With level 1 (the default), the error position is where the\n`error` function was called. Level 2 points the error to where the function\nthat called `error` was called; and so on. Passing a level 0 avoids the\naddition of error position information to the message.\n error_detail _m.textadept.run.error_detail [table]\nA table of error string details. Each entry is a table with the following\nfields: + `pattern`: The Lua pattern that matches a specific error string. +\n`filename`: The index of the Lua capture that contains the filename the\nerror occured in. + `line`: The index of the Lua capture that contains the\nline number the error occured on. + `message`: [Optional] The index of the\nLua capture that contains the error's message. A call tip will be displayed\nif a message was captured. When an error message is double-clicked, the\nuser is taken to the point of error. This table is usually populated by\nlanguage-specific modules.\n events _G.events [module]\nTextadept's core event structure and handlers.\n execute _m.textadept.run.execute(command)\nExecutes the command line parameter and prints the output to Textadept.\n@param command The command line string. It can have the following macros: +\n`%(filepath)`: The full path of the current file. + `%(filedir)`: The current\nfile's directory path. + `%(filename)`: The name of the file including\nextension. + `%(filename_noext)`: The name of the file excluding extension.\n -execute os.execute([command])\nThis function is equivalent to the C function `system`. It passes `command`\nto be executed by an operating system shell. It returns a status code,\nwhich is system-dependent. If `command` is absent, then it returns nonzero\nif a shell is available and zero otherwise.\n -exit os.exit([code])\nCalls the C function `exit`, with an optional `code`, to terminate the host\nprogram. The default value for `code` is the success code.\n +execute os.execute([command])\nThis function is equivalent to the C function `system`. It passes `command`\nto be executed by an operating system shell. Its first result is `true` if\nthe command terminated successfully, or `nil` otherwise. After this first\nresult the function returns a string and a number, as follows: "exit": the\ncommand terminated normally; the following number is the exit status of the\ncommand. "signal": the command was terminated by a signal; the following\nnumber is the signal that terminated the command. When called without a\n`command`, `os.execute` returns a boolean that is true if a shell is available.\n +exit os.exit([code [, close]])\nCalls the C function `exit` to terminate the host program. If `code` is\n`true`, the returned status is `EXIT_SUCCESS`; if `code` is `false`, the\nreturned status is `EXIT_FAILURE`; if `code` is a number, the returned status\nis this number. The default value for `code` is `true`. If the optional\nsecond argument `close` is true, closes the Lua state before exiting.\n exp math.exp(x)\nReturns the value *e^x*.\n extend lexer.extend\nMatches any ASCII extended character (`0`..`255`).\n extensions _m.textadept.mime_types.extensions [table]\nFile extensions with their associated lexers.\n extra_ascent buffer.extra_ascent [number]\nThe extra ascent, the maximum that any style extends above the baseline,\nadded to each line.\n extra_descent buffer.extra_descent [number]\nThe extra descent, the maximum that any style extends below the baseline,\nadded to each line.\n +extract bit32.extract(n, field [, width])\nReturns the unsigned number formed by the bits `field` to `field + width\n- 1` from `n`. Bits are numbered from 0 (least significant) to 31 (most\nsignificant). All accessed bits must be in the range [0, 31]. The default\nfor `width` is 1.\n filename buffer.filename [string]\nThe absolute path to the file associated with this buffer. It is encoded in\nUTF-8. Use `string.iconv()` for charset conversions.\n filter_through _m.textadept.filter_through [module]\nFilter-Through for the textadept module.\n filter_through _m.textadept.filter_through.filter_through()\nPrompts for a Linux, Mac OSX, or Windows shell command to filter text\nthrough. The standard input (stdin) for shell commands is determined as\nfollows: (1) If text is selected and spans multiple lines, all text on the\nlines containing the selection is used. However, if the end of the selection\nis at the beginning of a line, only the EOL (end of line) characters from the\nprevious line are included as input. The rest of the line is excluded. (2) If\ntext is selected and spans a single line, only the selected text is used. (3)\nIf no text is selected, the entire buffer is used. The input text is replaced\nwith the standard output (stdout) of the command.\n filteredlist gui.filteredlist(title, columns, items, int_return, ...)\nShortcut function for `gui.dialog('filtered_list', ...)` with 'Ok' and\n'Cancel' buttons.\n@param title The title for the filteredlist dialog.\n@param columns A column name or list of column names.\n@param items An item or list of items.\n@param int_return If `true`, returns the integer index of the selected item\nin the filteredlist. Defaults to `false`, which returns the string item. Not\ncompatible with a `'--select-multiple'` filteredlist.\n@param ... Additional parameters to pass to `gui.dialog()`.\n@usage gui.filteredlist('Title', 'Foo', { 'Bar', 'Baz' })\n@usage gui.filteredlist('Title', { 'Foo', 'Bar' }, { 'a', 'b', 'c', 'd' },\nfalse, '--output-column', '2')\n@return Either a string or integer on success; `nil` otherwise.\n find gui.find [module]\nTextadept's integrated find/replace dialog.\n -find string.find(s, pattern [, init [, plain]])\nLooks for the first match of `pattern` in the string `s`. If it finds a\nmatch, then `find` returns the indices of `s` where this occurrence starts\nand ends; otherwise, it returns nil. A third, optional numerical argument\n`init` specifies where to start the search; its default value is 1 and can\nbe negative. A value of true as a fourth, optional argument `plain` turns off\nthe pattern matching facilities, so the function does a plain "find substring"\noperation, with no characters in `pattern` being considered "magic". Note that\nif `plain` is given, then `init` must be given as well. If the pattern has\ncaptures, then in a successful match the captured values are also returned,\nafter the two indices.\n +find string.find(s, pattern [, init [, plain]])\nLooks for the first match of `pattern` in the string `s`. If it finds a\nmatch, then `find` returns the indices of `s` where this occurrence starts\nand ends; otherwise, it returns nil. A third, optional numerical argument\n`init` specifies where to start the search; its default value is 1 and can\nbe negative. A value of true as a fourth, optional argument `plain` turns off\nthe pattern matching facilities, so the function does a plain "find substring"\noperation, with no characters in `pattern` being considered magic. Note that\nif `plain` is given, then `init` must be given as well. If the pattern has\ncaptures, then in a successful match the captured values are also returned,\nafter the two indices.\n find_column buffer.find_column(buffer, line, column)\nFind the position of a column on a line taking into account tabs and multi-byte\ncharacters. If beyond end of line, return line end position.\n@param buffer The global buffer.\n@param line The line number.\n@param column The column number.\n find_entry_text gui.find.find_entry_text [string]\nThe text in the find entry.\n find_in_files gui.find.find_in_files(utf8_dir)\nPerforms a find in files with the given directory. Use the `gui.find` fields\nto set the text to find and option flags.\n@param utf8_dir UTF-8 encoded directory name. If none is provided, the user\nis prompted for one.\n @@ -981,7 +989,7 @@ first_visible_line buffer.first_visible_line [number]\nThe display line at the t float lexer.float\nMatches a floating point number.\n floor math.floor(x)\nReturns the largest integer smaller than or equal to `x`.\n flush file:flush()\nSaves any written data to `file`.\n -flush io.flush()\nEquivalent to `file:flush` over the default output file.\n +flush io.flush()\nEquivalent to `io.output():flush()`.\n fmod math.fmod(x, y)\nReturns the remainder of the division of `x` by `y` that rounds the quotient\ntowards zero.\n focus buffer.focus [bool]\nThe internal focus flag.\n focus gui.command_entry.focus()\nFocuses the command entry.\n @@ -993,8 +1001,8 @@ fold_line_comments lexer.fold_line_comments(prefix)\nReturns a fold function tha fold_parent buffer.fold_parent [table]\nTable of parent line numbers for child lines starting from zero. -1 means\nno line was found. (Read-only)\n font_quality buffer.font_quality [number]\nThe quality level for text. (Windows only)\n * `_SCINTILLA.constants.SC_EFF_QUALITY_DEFAULt` (0).\n * `_SCINTILLA.constants.SC_EFF_QUALITY_NON_ANTIALIASED` (1).\n * `_SCINTILLA.constants.SC_EFF_QUALITY_ANTIALIASED` (2).\n * `_SCINTILLA.constants.SC_EFF_QUALITY_LCD_OPTIMIZED` (3).\n\n form_feed buffer.form_feed(buffer)\nInsert a Form Feed character.\n@param buffer The global buffer.\n -format string.format(formatstring, ···)\nReturns a formatted version of its variable number of arguments following\nthe description given in its first argument (which must be a string). The\nformat string follows the same rules as the `printf` family of standard C\nfunctions. The only differences are that the options/modifiers `*`, `l`,\n`L`, `n`, `p`, and `h` are not supported and that there is an extra option,\n`q`. The `q` option formats a string in a form suitable to be safely read back\nby the Lua interpreter: the string is written between double quotes, and all\ndouble quotes, newlines, embedded zeros, and backslashes in the string are\ncorrectly escaped when written. For instance, the call string.format('%q',\n'a string with "quotes" and \\n new line') will produce the string: "a string\nwith \"quotes\" and \ new line" The options `c`, `d`, `E`, `e`, `f`, `g`,\n`G`, `i`, `o`, `u`, `X`, and `x` all expect a number as argument, whereas\n`q` and `s` expect a string. This function does not accept string values\ncontaining embedded zeros, except as arguments to the `q` option.\n -frexp math.frexp(x)\nReturns `m` and `e` such that *x = m2^e*, `e` is an integer and the absolute\nvalue of `m` is in the range *[0.5, 1)* (or zero when `x` is zero).\n +format string.format(formatstring, ···)\nReturns a formatted version of its variable number of arguments following\nthe description given in its first argument (which must be a string). The\nformat string follows the same rules as the C function `sprintf`. The only\ndifferences are that the options/modifiers `*`, `h`, `L`, `l`, `n`, and\n`p` are not supported and that there is an extra option, `q`. The `q`\noption formats a string between double quotes, using escape sequences\nwhen necessary to ensure that it can safely be read back by the Lua\ninterpreter. For instance, the call string.format('%q', 'a string with\n"quotes" and \\n new line') may produce the string: "a string with\n\"quotes\" and \ new line" Options `A` and `a` (when available), `E`, `e`,\n`f`, `G`, and `g` all expect a number as argument. Options `c`, `d`, `i`,\n`o`, `u`, `X`, and `x` also expect a number, but the range of that number\nmay be limited by the underlying C implementation. For options `o`, `u`, `X`,\nand `x`, the number cannot be negative. Option `q` expects a string; option\n`s` expects a string without embedded zeros. If the argument to option `s`\nis not a string, it is converted to one following the same rules of `tostring`.\n +frexp math.frexp(x)\nReturns `m` and `e` such that 'x = m2^e', `e` is an integer and the absolute\nvalue of `m` is in the range *[0.5, 1)* (or zero when `x` is zero).\n functions _SCINTILLA.functions [table]\nScintilla functions.\n get_apidoc _m.textadept.adeptsense.get_apidoc(sense, symbol)\nReturns a list of apidocs for the given symbol. If there are multiple apidocs,\nthe index of one to display is the value of the `pos` key in the returned list.\n@param sense The Adeptsense returned by `adeptsense.new()`.\n@param symbol The symbol to get apidocs for.\n@return apidoc_list or `nil`\n get_class _m.textadept.adeptsense.get_class(sense, symbol)\nReturns the class name for a given symbol. If the symbol is `sense.syntax.self`\nand a class definition using the `sense.syntax.class_definition` keyword is\nfound, that class is returned. Otherwise the buffer is searched backwards\nfor a type declaration of the symbol according to the patterns in\n`sense.syntax.type_declarations`.\n@param sense The Adeptsense returned by `adeptsense.new()`.\n@param symbol The symbol to get the class of.\n@return class or `nil`\n@see syntax\n @@ -1021,17 +1029,16 @@ get_symbol _m.textadept.adeptsense.get_symbol(sense)\nReturns a full symbol (if get_tag buffer.get_tag(buffer, tag_num)\nRetrieve the value of a tag from a regular expression search.\n@param buffer The global buffer.\n@param tag_num The tag number.\n@return string\n get_text buffer.get_text(buffer)\nRetrieve all the text in the document. Also returns number of characters\nretrieved.\n@param buffer The global buffer.\n getenv os.getenv(varname)\nReturns the value of the process environment variable `varname`, or nil if\nthe variable is not defined.\n -getfenv _G.getfenv([f])\nReturns the current environment in use by the function. `f` can be a Lua\nfunction or a number that specifies the function at that stack level:\nLevel 1 is the function calling `getfenv`. If the given function is not a\nLua function, or if `f` is 0, `getfenv` returns the global environment. The\ndefault for `f` is 1.\n -getfenv debug.getfenv(o)\nReturns the environment of object `o`.\n gethook debug.gethook([thread])\nReturns the current hook settings of the thread, as three values: the current\nhook function, the current hook mask, and the current hook count (as set by\nthe `debug.sethook` function).\n -getinfo debug.getinfo([thread, ] function [, what])\nReturns a table with information about a function. You can give the function\ndirectly, or you can give a number as the value of `function`, which means\nthe function running at level `function` of the call stack of the given\nthread: level 0 is the current function (`getinfo` itself); level 1 is the\nfunction that called `getinfo`; and so on. If `function` is a number larger\nthan the number of active functions, then `getinfo` returns nil. The returned\ntable can contain all the fields returned by `lua_getinfo`, with the string\n`what` describing which fields to fill in. The default for `what` is to get\nall information available, except the table of valid lines. If present,\nthe option '`f`' adds a field named `func` with the function itself. If\npresent, the option '`L`' adds a field named `activelines` with the table\nof valid lines. For instance, the expression `debug.getinfo(1,"n").name`\nreturns a table with a name for the current function, if a reasonable name\ncan be found, and the expression `debug.getinfo(print)` returns a table with\nall available information about the `print` function.\n -getlocal debug.getlocal([thread, ] level, local)\nThis function returns the name and the value of the local variable with index\n`local` of the function at level `level` of the stack. (The first parameter\nor local variable has index 1, and so on, until the last active local\nvariable.) The function returns nil if there is no local variable with the\ngiven index, and raises an error when called with a `level` out of range. (You\ncan call `debug.getinfo` to check whether the level is valid.) Variable\nnames starting with '`(`' (open parentheses) represent internal variables\n(loop control variables, temporaries, and C function locals).\n +getinfo debug.getinfo([thread, ] f [, what])\nReturns a table with information about a function. You can give the function\ndirectly or you can give a number as the value of `f`, which means the function\nrunning at level `f` of the call stack of the given thread: level 0 is the\ncurrent function (`getinfo` itself); level 1 is the function that called\n`getinfo` and so on. If `f` is a number larger than the number of active\nfunctions, then `getinfo` returns nil. The returned table can contain all\nthe fields returned by `lua_getinfo`, with the string `what` describing which\nfields to fill in. The default for `what` is to get all information available,\nexcept the table of valid lines. If present, the option '`f`' adds a field\nnamed `func` with the function itself. If present, the option '`L`' adds\na field named `activelines` with the table of valid lines. For instance,\nthe expression `debug.getinfo(1,"n").name` returns a table with a name for\nthe current function, if a reasonable name can be found, and the expression\n`debug.getinfo(print)` returns a table with all available information about\nthe `print` function.\n +getlocal debug.getlocal([thread, ] f, local)\nThis function returns the name and the value of the local variable with index\n`local` of the function at level `f` of the stack. This function accesses\nnot only explicit local variables, but also parameters, temporaries, etc.\nThe first parameter or local variable has index 1, and so on, until the last\nactive variable. Negative indices refer to vararg parameters; -1 is the\nfirst vararg parameter. The function returns nil if there is no variable\nwith the given index, and raises an error when called with a level out of\nrange. (You can call `debug.getinfo` to check whether the level is valid.)\nVariable names starting with '`(`' (open parentheses) represent internal\nvariables (loop control variables, temporaries, varargs, and C function\nlocals). The parameter `f` may also be a function. In that case, `getlocal`\nreturns only the name of function parameters.\n getmetatable _G.getmetatable(object)\nIf `object` does not have a metatable, returns nil. Otherwise, if the object's\nmetatable has a `"__metatable"` field, returns the associated value. Otherwise,\nreturns the metatable of the given object.\n -getmetatable debug.getmetatable(object)\nReturns the metatable of the given `object` or nil if it does not have\na metatable.\n -getregistry debug.getregistry()\nReturns the registry table (see §3.5).\n -getupvalue debug.getupvalue(func, up)\nThis function returns the name and the value of the upvalue with index `up`\nof the function `func`. The function returns nil if there is no upvalue with\nthe given index.\n -gmatch string.gmatch(s, pattern)\nReturns an iterator function that, each time it is called, returns the\nnext captures from `pattern` over string `s`. If `pattern` specifies no\ncaptures, then the whole match is produced in each call. As an example,\nthe following loop s = "hello world from Lua" for w in string.gmatch(s,\n"%a+") do print(w) end will iterate over all the words from string `s`,\nprinting one per line. The next example collects all pairs `key=value`\nfrom the given string into a table: t = {} s = "from=world, to=Lua" for k,\nv in string.gmatch(s, "(%w+)=(%w+)") do t[k] = v end For this function, a\n'`^`' at the start of a pattern does not work as an anchor, as this would\nprevent the iteration.\n -goto _m.textadept.bookmarks.goto()\nGoes to selected bookmark from a filtered list.\n +getmetatable debug.getmetatable(value)\nReturns the metatable of the given `value` or nil if it does not have\na metatable.\n +getregistry debug.getregistry()\nReturns the registry table (see §4.5).\n +getupvalue debug.getupvalue(f, up)\nThis function returns the name and the value of the upvalue with index `up`\nof the function `f`. The function returns nil if there is no upvalue with\nthe given index.\n +getuservalue debug.getuservalue(u)\nReturns the Lua value associated to `u`. If `u` is not a userdata, returns nil.\n +gmatch string.gmatch(s, pattern)\nReturns an iterator function that, each time it is called, returns the\nnext captures from `pattern` over the string `s`. If `pattern` specifies\nno captures, then the whole match is produced in each call. As an example,\nthe following loop will iterate over all the words from string `s`, printing\none per line: s = "hello world from Lua" for w in string.gmatch(s, "%a+")\ndo print(w) end The next example collects all pairs `key=value` from the\ngiven string into a table: t = {} s = "from=world, to=Lua" for k, v in\nstring.gmatch(s, "(%w+)=(%w+)") do t[k] = v end For this function, a caret\n'`^`' at the start of a pattern does not work as an anchor, as this would\nprevent the iteration.\n +goto_bookmark _m.textadept.bookmarks.goto_bookmark()\nGoes to selected bookmark from a filtered list.\n goto_buffer view:goto_buffer(n, relative)\nGoes to the specified buffer in the indexed view. Generates\n`BUFFER_BEFORE_SWITCH` and `BUFFER_AFTER_SWITCH` events.\n@param n A relative or absolute buffer index. An absolute index of `-1`\ngoes to the last buffer.\n@param relative Flag indicating if `n` is a relative index or not. Defaults to\n`false`.\n goto_ctag _m.textadept.adeptsense.goto_ctag(sense, k, title)\nDisplays a filteredlist of all known symbols of the given kind (classes,\nfunctions, fields, etc.) and jumps to the source of the selected one.\n@param sense The Adeptsense returned by `adeptsense.new()`.\n@param k The ctag character kind (e.g. `'f'` for a Lua function).\n@param title The title for the filteredlist dialog.\n goto_error _m.textadept.run.goto_error(pos, line_num)\nWhen the user double-clicks an error message, go to the line in the file\nthe error occured at and display a calltip with the error message.\n@param pos The position of the caret.\n@param line_num The line double-clicked.\n@see error_detail\n @@ -1049,7 +1056,7 @@ goto_view gui.goto_view(n, relative)\nGoes to the specified view. Generates `VIE grab_focus buffer.grab_focus(buffer)\nSet the focus to this view.\n@param buffer The global buffer.\n graph lexer.graph\nMatches any graphical character (`!` to `~`).\n grow_selection _m.textadept.editing.grow_selection(amount)\nGrows the selection by a character amount on either end.\n@param amount The amount to grow the selection on either end.\n -gsub string.gsub(s, pattern, repl [, n])\nReturns a copy of `s` in which all (or the first `n`, if given) occurrences\nof the `pattern` have been replaced by a replacement string specified by\n`repl`, which can be a string, a table, or a function. `gsub` also returns,\nas its second value, the total number of matches that occurred. If `repl`\nis a string, then its value is used for replacement. The character `%`\nworks as an escape character: any sequence in `repl` of the form `%n`, with\n*n* between 1 and 9, stands for the value of the *n*-th captured substring\n(see below). The sequence `%0` stands for the whole match. The sequence `%%`\nstands for a single `%`. If `repl` is a table, then the table is queried for\nevery match, using the first capture as the key; if the pattern specifies no\ncaptures, then the whole match is used as the key. If `repl` is a function,\nthen this function is called every time a match occurs, with all captured\nsubstrings passed as arguments, in order; if the pattern specifies no\ncaptures, then the whole match is passed as a sole argument. If the value\nreturned by the table query or by the function call is a string or a number,\nthen it is used as the replacement string; otherwise, if it is false or nil,\nthen there is no replacement (that is, the original match is kept in the\nstring). Here are some examples: x = string.gsub("hello world", "(%w+)",\n"%1 %1") --> x="hello hello world world" x = string.gsub("hello world", "%w+",\n"%0 %0", 1) --> x="hello hello world" x = string.gsub("hello world from Lua",\n"(%w+)%s*(%w+)", "%2 %1") --> x="world hello Lua from" x = string.gsub("home =\n$HOME, user = $USER", "%$(%w+)", os.getenv) --> x="home = /home/roberto, user =\nroberto" x = string.gsub("4+5 = $return 4+5$", "%$(.-)%$", function (s) return\nloadstring(s)() end) --> x="4+5 = 9" local t = {name="lua", version="5.1"}\nx = string.gsub("$name-$version.tar.gz", "%$(%w+)", t) --> x="lua-5.1.tar.gz"\n +gsub string.gsub(s, pattern, repl [, n])\nReturns a copy of `s` in which all (or the first `n`, if given) occurrences of\nthe `pattern` have been replaced by a replacement string specified by `repl`,\nwhich can be a string, a table, or a function. `gsub` also returns, as its\nsecond value, the total number of matches that occurred. The name `gsub`\ncomes from "Global SUBstitution". If `repl` is a string, then its value\nis used for replacement. The character `%` works as an escape character:\nany sequence in `repl` of the form `%d`, with `d` between 1 and 9, stands\nfor the value of the `d`-th captured substring (see below). The sequence\n`%0` stands for the whole match. The sequence `%%` stands for a single\n`%`. If `repl` is a table, then the table is queried for every match,\nusing the first capture as the key; if the pattern specifies no captures,\nthen the whole match is used as the key. If `repl` is a function, then this\nfunction is called every time a match occurs, with all captured substrings\npassed as arguments, in order; if the pattern specifies no captures, then\nthe whole match is passed as a sole argument. If the value returned by\nthe table query or by the function call is a string or a number, then it\nis used as the replacement string; otherwise, if it is false or nil, then\nthere is no replacement (that is, the original match is kept in the string).\nHere are some examples: x = string.gsub("hello world", "(%w+)", "%1 %1")\n--> x="hello hello world world" x = string.gsub("hello world", "%w+", "%0\n%0", 1) --> x="hello hello world" x = string.gsub("hello world from Lua",\n"(%w+)%s*(%w+)", "%2 %1") --> x="world hello Lua from" x = string.gsub("home\n= $HOME, user = $USER", "%$(%w+)", os.getenv) --> x="home = /home/roberto,\nuser = roberto" x = string.gsub("4+5 = $return 4+5$", "%$(.-)%$", function (s)\nreturn load(s)() end) --> x="4+5 = 9" local t = {name="lua", version="5.2"}\nx = string.gsub("$name-$version.tar.gz", "%$(%w+)", t) --> x="lua-5.2.tar.gz"\n gtkmenu gui.gtkmenu(menu_table)\nCreates a GTK menu, returning the userdata.\n@param menu_table A table defining the menu. It is an ordered list of tables\nwith a string menu item, integer menu ID, and optional keycode and modifier\nmask. The latter two are used to display key shortcuts in the menu. The\nstring menu item is handled as follows: `'gtk-*'` - a stock menu item is\ncreated based on the GTK stock-id. `'separator'` - a menu separator item is\ncreated. Otherwise a regular menu item with a mnemonic is created. Submenus\nare just nested menu-structure tables. Their title text is defined with a\n`title` key.\n@see keys.get_gdk_key\n gui _G.gui [module]\nThe core gui table.\n h_scroll_bar buffer.h_scroll_bar [bool]\nWhether the horizontal scroll bar is visible. Set to `false` to never see it\nand `true` to enable it again. The default state is to display it when needed.\n @@ -1093,12 +1100,12 @@ indicator_start buffer.indicator_start(buffer, indicator, pos)\nFind the positio indicator_value buffer.indicator_value [number]\nThe indicator value used for `buffer:indicator_fill_range()`. Currently all\nvalues are drawn the same.\n indicator_value_at buffer.indicator_value_at(buffer, indicator, pos)\nRetrieve the value of a particular indicator at a position. Currently all\nvalues are drawn the same.\n@param buffer The global buffer.\n@param indicator The indicator number in the range of `0` to `31`.\n@param pos The position.\n@return number\n inherited_classes _m.textadept.adeptsense.inherited_classes [table]\nContains a map of classes and a list of their inherited classes.\n -input io.input([file])\nWhen called with a file name, it opens the named file (in text mode), and\nsets its handle as the default input file. When called with a file handle,\nit simply sets this file handle as the default input file. When called\nwithout parameters, it returns the current default input file. In case of\nerrors this function raises the error, instead of returning an error code.\n -insert table.insert(table, [pos, ] value)\nInserts element `value` at position `pos` in `table`, shifting up other\nelements to open space, if necessary. The default value for `pos` is\n`n+1`, where `n` is the length of the table (see §2.5.5), so that a call\n`table.insert(t,x)` inserts `x` at the end of table `t`.\n +input io.input([file])\nWhen called with a file name, it opens the named file (in text mode), and\nsets its handle as the default input file. When called with a file handle, it\nsimply sets this file handle as the default input file. When called without\nparameters, it returns the current default input file. In case of errors\nthis function raises the error, instead of returning an error code.\n +insert table.insert(list, [pos, ] value)\nInserts element `value` at position `pos` in `list`, shifting up the elements\n`list[pos], list[pos+1], ···, list[#list]`. The default value for `pos` is\n`#list+1`, so that a call `table.insert(t,x)` inserts `x` at the end of list\n`t`.\n insert_text buffer.insert_text(buffer, pos, text)\nInsert string at a position. If the current position is after the insertion\npoint then it is moved along with its surrounding text but no scrolling\nis performed.\n@param buffer The global buffer.\n@param pos The position to insert text at or `-1` for the current position.\n@param text The text to insert.\n integer lexer.integer\nMatches a decimal, hexadecimal, or octal number.\n io _G.io [module]\nLua io module.\n -ipairs _G.ipairs(t)\nReturns three values: an iterator function, the table `t`, and 0, so that\nthe construction for i,v in ipairs(t) do *body* end will iterate over the\npairs (`1,t[1]`), (`2,t[2]`), ···, up to the first integer key absent\nfrom the table.\n +ipairs _G.ipairs(t)\nIf `t` has a metamethod `__ipairs`, calls it with `t` as argument and returns\nthe first three results from the call. Otherwise, returns three values:\nan iterator function, the table `t`, and 0, so that the construction for\ni,v in ipairs(t) do *body* end will iterate over the pairs (`1,t[1]`),\n(`2,t[2]`), ..., up to the first integer key absent from the table.\n java _G.keys.java [table]\nContainer for Java-specific key commands.\n java _G.snippets.java [table]\nContainer for Java-specific snippets.\n java _m.java [module]\nThe java module. It provides utilities for editing Java code. User tags\nare loaded from _USERHOME/modules/java/tags and user apis are loaded from\n_USERHOME/modules/java/api.\n @@ -1107,7 +1114,7 @@ keys _G.keys [module]\nManages key commands in Textadept.\n keys _m.textadept.keys [module]\nDefines key commands for Textadept. This set of key commands is pretty\nstandard among other text editors. This module, should be 'require'ed last,\nbut before _m.textadept.menu.\n keys_unicode buffer.keys_unicode [bool]\nInterpret keyboard input as Unicode.\n layout_cache buffer.layout_cache [number]\nThe degree of caching of layout information.\n * `_SCINTILLA.constants.SC_CACHE_NONE` (0): No lines are cached.\n * `_SCINTILLA.constants.SC_CACHE_CARET` (1): The line containing the\n text caret. This is the default.\n * `_SCINTILLA.constants.SC_CACHE_PAGE` (2): Visible lines plus the line\n containing the caret.\n * `_SCINTILLA.constants.SC_CACHE_DOCUMENT` (3): All lines in the\n document.\n\n -ldexp math.ldexp(m, e)\nReturns *m2^e* (`e` should be an integer).\n +ldexp math.ldexp(m, e)\nReturns 'm2^e' (`e` should be an integer).\n len string.len(s)\nReceives a string and returns its length. The empty string `""` has length\n0. Embedded zeros are counted, so `"a\000bc\000"` has length 5.\n length buffer.length [number]\nThe number of bytes in the document. (Read-only)\n lex lexer.lex(text, init_style)\nLexes the given text. Called by LexLPeg.cxx; do not call from Lua. If the lexer\nhas a _LEXBYLINE flag set, the text is lexed one line at a time. Otherwise\nthe text is lexed as a whole.\n@param text The text to lex.\n@param init_style The current style. Multilang lexers use this to determine\nwhich language to start lexing in.\n @@ -1144,34 +1151,33 @@ line_up buffer.line_up(buffer)\nMove caret up one line.\n@param buffer The globa line_up_extend buffer.line_up_extend(buffer)\nMove caret up one line extending selection to new caret position.\n@param buffer The global buffer.\n line_up_rect_extend buffer.line_up_rect_extend(buffer)\nMove caret up one line, extending rectangular selection to new caret position.\n@param buffer The global buffer.\n line_visible buffer.line_visible [bool]\nIs a line visible? (Read-only)\n -lines file:lines()\nReturns an iterator function that, each time it is called, returns a new\nline from the file. Therefore, the construction for line in file:lines()\ndo *body* end will iterate over all lines of the file. (Unlike `io.lines`,\nthis function does not close the file when the loop ends.)\n -lines io.lines([filename])\nOpens the given file name in read mode and returns an iterator function that,\neach time it is called, returns a new line from the file. Therefore, the\nconstruction for line in io.lines(filename) do *body* end will iterate over\nall lines of the file. When the iterator function detects the end of file,\nit returns nil (to finish the loop) and automatically closes the file. The\ncall `io.lines()` (with no file name) is equivalent to `io.input():lines()`;\nthat is, it iterates over the lines of the default input file. In this case\nit does not close the file when the loop ends.\n +lines file:lines(···)\nReturns an iterator function that, each time it is called, reads the\nfile according to the given formats. When no format is given, uses "*l"\nas a default. As an example, the construction for c in file:lines(1) do\nbody end will iterate over all characters of the file, starting\nat the current position. Unlike `io.lines`, this function does not close the\nfile when the loop ends. In case of errors this function raises the error,\ninstead of returning an error code.\n +lines io.lines([filename ···])\nOpens the given file name in read mode and returns an iterator function\nthat works like `file:lines(···)` over the opened file. When the iterator\nfunction detects -- the end of file, it returns nil (to finish the loop) and\nautomatically closes the file. The call `io.lines()` (with no file name)\nis equivalent to `io.input():lines()`; that is, it iterates over the lines\nof the default input file. In this case it does not close the file when the\nloop ends. In case of errors this function raises the error, instead of\nreturning an error code.\n lines_join buffer.lines_join(buffer)\nJoin the lines in the target. Where this would lead to no space between words,\nan extra space is inserted.\n@param buffer The global buffer.\n lines_on_screen buffer.lines_on_screen [number]\nThe number of lines completely visible. (Read-only)\n lines_split buffer.lines_split(buffer, pixel_width)\nSplit the lines in the target into lines that are less wide than `pixel_width`\nwhere possible.\n@param buffer The global buffer.\n@param pixel_width The pixel width. When `0`, the width of the view is used.\n lines_visible buffer.lines_visible [bool]\nAre all lines visible? (Read-only)\n -load _G.load(func [, chunkname])\nLoads a chunk using function `func` to get its pieces. Each call to `func`\nmust return a string that concatenates with previous results. A return of\nan empty string, nil, or no value signals the end of the chunk. If there\nare no errors, returns the compiled chunk as a function; otherwise, returns\nnil plus the error message. The environment of the returned function is the\nglobal environment. `chunkname` is used as the chunk name for error messages\nand debug information. When absent, it defaults to "`=(load)`".\n +load _G.load(ld [, source [, mode [, env]]])\nLoads a chunk. If `ld` is a string, the chunk is this string. If `ld` is a\nfunction, `load` calls it repeatedly to get the chunk pieces. Each call to `ld`\nmust return a string that concatenates with previous results. A return of an\nempty string, nil, or no value signals the end of the chunk. If there are no\nsyntactic errors, returns the compiled chunk as a function; otherwise, returns\nnil plus the error message. If the resulting function has upvalues,\nthe first upvalue is set to the value of the global environment or to `env`,\nif that parameter is given. When loading main chunks, the first upvalue will\nbe the `_ENV` variable (see §2.2). `source` is used as the source of the\nchunk for error messages and debug information (see §4.9). When absent,\nit defaults to `ld`, if `ld` is a string, or to "`=(load)`" otherwise.\nThe string `mode` controls whether the chunk can be text or binary (that is,\na precompiled chunk). It may be the string "`b`" (only binary chunks), "`t`"\n(only text chunks), or "`bt`" (both binary and text). The default is "`bt`".\n load _m.textadept.session.load(filename)\nLoads a Textadept session file. Textadept restores split views, opened buffers,\ncursor information, and project manager details.\n@param filename The absolute path to the session file to load. Defaults to\n`DEFAULT_SESSION` if not specified.\n@usage _m.textadept.session.load(filename)\n@return `true` if the session file was opened and read; `false` otherwise.\n load lexer.load(lexer_name)\nInitializes the specified lexer.\n@param lexer_name The name of the lexing language.\n load_ctags _m.textadept.adeptsense.load_ctags(sense, tag_file, nolocations)\nLoads the given ctags file for autocompletion. It is recommended to pass\n`-n` to ctags in order to use line numbers instead of text patterns to locate\ntags. This will greatly reduce memory usage for a large number of symbols if\n`nolocations` is not `true`.\n@param sense The Adeptsense returned by `adeptsense.new()`.\n@param tag_file The path of the ctags file to load.\n@param nolocations If `true`, does not store the locations of the tags for\nuse by `goto_ctag()`. Defaults to `false`.\n -load_project _m.rails.load_project(utf8_dir)\nSets keys.al.o to snapopen a Rails project. If not directory is provided,\nthe user is prompted for one.\n@param utf8_dir The UTF-8 Rails project directory.\n -loaded package.loaded\nA table used by `require` to control which modules are already loaded. When\nyou require a module `modname` and `package.loaded[modname]` is not false,\n`require` simply returns the value stored there.\n -loaders package.loaders\nA table used by `require` to control how to load modules. Each entry in\nthis table is a *searcher function*. When looking for a module, `require`\ncalls each of these searchers in ascending order, with the module name\n(the argument given to `require`) as its sole parameter. The function can\nreturn another function (the module *loader*) or a string explaining why it\ndid not find that module (or nil if it has nothing to say). Lua initializes\nthis table with four functions. The first searcher simply looks for a loader\nin the `package.preload` table. The second searcher looks for a loader as a\nLua library, using the path stored at `package.path`. A path is a sequence\nof *templates* separated by semicolons. For each template, the searcher will\nchange each interrogation mark in the template by `filename`, which is the\nmodule name with each dot replaced by a "directory separator" (such as "`/`"\nin Unix); then it will try to open the resulting file name. So, for instance,\nif the Lua path is the string\n "./?.lua;./?.lc;/usr/local/?/init.lua"\nthe search for a Lua file for module `foo` will try to open the files\n`./foo.lua`, `./foo.lc`, and `/usr/local/foo/init.lua`, in that order. The\nthird searcher looks for a loader as a C library, using the path given by\nthe variable `package.cpath`. For instance, if the C path is the string\n "./?.so;./?.dll;/usr/local/?/init.so"\nthe searcher for module `foo` will try to open the files `./foo.so`,\n`./foo.dll`, and `/usr/local/foo/init.so`, in that order. Once it finds\na C library, this searcher first uses a dynamic link facility to link the\napplication with the library. Then it tries to find a C function inside the\nlibrary to be used as the loader. The name of this C function is the string\n"`luaopen_`" concatenated with a copy of the module name where each dot is\nreplaced by an underscore. Moreover, if the module name has a hyphen, its\nprefix up to (and including) the first hyphen is removed. For instance, if the\nmodule name is `a.v1-b.c`, the function name will be `luaopen_b_c`. The fourth\nsearcher tries an *all-in-one loader*. It searches the C path for a library\nfor the root name of the given module. For instance, when requiring `a.b.c`,\nit will search for a C library for `a`. If found, it looks into it for an open\nfunction for the submodule; in our example, that would be `luaopen_a_b_c`. With\nthis facility, a package can pack several C submodules into one single library,\nwith each submodule keeping its original open function.\n -loadfile _G.loadfile([filename])\nSimilar to `load`, but gets the chunk from file `filename` or from the\nstandard input, if no file name is given.\n -loadlib package.loadlib(libname, funcname)\nDynamically links the host program with the C library `libname`. Inside this\nlibrary, looks for a function `funcname` and returns this function as a C\nfunction. (So, `funcname` must follow the protocol (see `lua_CFunction`)). This\nis a low-level function. It completely bypasses the package and module\nsystem. Unlike `require`, it does not perform any path searching and does\nnot automatically adds extensions. `libname` must be the complete file name\nof the C library, including if necessary a path and extension. `funcname`\nmust be the exact name exported by the C library (which may depend on the C\ncompiler and linker used). This function is not supported by ANSI C. As such,\nit is only available on some platforms (Windows, Linux, Mac OS X, Solaris,\nBSD, plus other Unix systems that support the `dlfcn` standard).\n -loadstring _G.loadstring(string [, chunkname])\nSimilar to `load`, but gets the chunk from the given string. To load and\nrun a given string, use the idiom assert(loadstring(s))() When absent,\n`chunkname` defaults to the given string.\n +load_project M.load_project(utf8_dir)\nSets keys.al.o to snapopen a Rails project. If not directory is provided,\nthe user is prompted for one.\n@param utf8_dir The UTF-8 Rails project directory.\n +loaded package.loaded\nA table used by `require` to control which modules are already loaded. When\nyou require a module `modname` and `package.loaded[modname]` is not false,\n`require` simply returns the value stored there. This variable is only a\nreference to the real table; assignments to this variable do not change the\ntable used by `require`.\n +loadfile _G.loadfile([filename [, mode [, env]]])\nSimilar to `load`, but gets the chunk from file `filename` or from the\nstandard input, if no file name is given.\n +loadlib package.loadlib(libname, funcname)\nDynamically links the host program with the C library `libname`. If `funcname`\nis "`*`", then it only links with the library, making the symbols exported\nby the library available to other dynamically linked libraries. Otherwise, it\nlooks for a function `funcname` inside the library and returns this function\nas a C function. (So, `funcname` must follow the prototype `lua_CFunction`).\nThis is a low-level function. It completely bypasses the package and module\nsystem. Unlike `require`, it does not perform any path searching and does\nnot automatically adds extensions. `libname` must be the complete file name\nof the C library, including if necessary a path and an extension. `funcname`\nmust be the exact name exported by the C library (which may depend on the\nC compiler and linker used). This function is not supported by Standard\nC. As such, it is only available on some platforms (Windows, Linux, Mac OS X,\nSolaris, BSD, plus other Unix systems that support the `dlfcn` standard).\n locale _G.locale [module]\nContains all messages used by Textadept for localization.\n -locale lpeg.locale([table])\nReturns a table with patterns for matching some character classes according\nto the current locale. The table has fields named alnum, alpha, cntrl, digit,\ngraph, lower, print, punct, space, upper, and xdigit, each one containing a\ncorrespondent pattern. Each pattern matches any single character that belongs\nto its class. If called with an argument table, then it creates those fields\ninside the given table and returns that table.\n +locale lpeg.locale([table])\nReturns a table with patterns for matching some character classes according\nto the current locale. The table has fields named alnum, alpha, cntrl, digit,\ngraph, lower, print, punct, space, upper, and xdigit, each one containing\na correspondent pattern. Each pattern matches any single character that\nbelongs to its class. If called with an argument table, then it creates\nthose fields inside the given table and returns that table.\n localize locale.localize(id)\nLocalizes the given string.\n@param id String to localize.\n locations _m.textadept.adeptsense.locations [table]\nContains the locations of known symbols. This table is populated by\n`load_ctags()`.\n -lock lfs.lock(filehandle, mode[, start[, length]])\nLocks a file or a part of it. This function works on open files; the file\nhandle should be specified as the first argument. The string mode could be\neither r (for a read/shared lock) or w (for a write/exclusive lock). The\noptional arguments start and length can be used to specify a starting point\nand its length; both should be numbers. Returns true if the operation was\nsuccessful; in case of error, it returns nil plus an error string.\n -lock_dir lfs.lock_dir(path, [seconds_stale])\nCreates a lockfile (called lockfile.lfs) in path if it does not exist and\nreturns the lock. If the lock already exists checks it it's stale, using\nthe second parameter (default for the second parameter is INT_MAX, which\nin practice means the lock will never be stale. To free the the lock call\nlock:free(). In case of any errors it returns nil and the error message. In\nparticular, if the lock exists and is not stale it returns the "File exists"\nmessage.\n -log math.log(x)\nReturns the natural logarithm of `x`.\n -log10 math.log10(x)\nReturns the base-10 logarithm of `x`.\n +lock lfs.lock(filehandle, mode[, start[, length]])\nLocks a file or a part of it. This function works on open files; the file\nhandle should be specified as the first argument. The string mode could be\neither r (for a read/shared lock) or w (for a write/exclusive lock). The\noptional arguments start and length can be used to specify a starting point\nand its length; both should be numbers. Returns true if the operation was\nsuccessful; in case of error, it returns nil plus an error string.\n +lock_dir lfs.lock_dir(path, [seconds_stale])\nCreates a lockfile (called lockfile.lfs) in path if it does not exist\nand returns the lock. If the lock already exists checks it it's stale,\nusing the second parameter (default for the second parameter is INT_MAX,\nwhich in practice means the lock will never be stale. To free the the\nlock call lock:free(). In case of any errors it returns nil and the error\nmessage. In particular, if the lock exists and is not stale it returns the\n"File exists" message.\n +log math.log(x [, base])\nReturns the logarithm of `x` in the given base. The default for `base` is 'e'\n(so that the function returns the natural logarithm of `x`).\n lower lexer.lower\nMatches any lowercase character (`a-z`).\n lower string.lower(s)\nReceives a string and returns a copy of this string with all uppercase\nletters changed to lowercase. All other characters are left unchanged. The\ndefinition of what an uppercase letter is depends on the current locale.\n lower_case buffer.lower_case(buffer)\nTransform the selection to lower case.\n@param buffer The global buffer.\n lpeg _G.lpeg [module]\nLua lpeg module.\n +lrotate bit32.lrotate(x, disp)\nReturns the number `x` rotated `disp` bits to the left. The number `disp`\nmay be any representable integer. For any valid displacement, the following\nidentity holds: assert(bit32.lrotate(x, disp) == bit32.lrotate(x, disp %\n32)) In particular, negative displacements rotate to the right.\n +lshift bit32.lshift(x, disp)\nReturns the number `x` shifted `disp` bits to the left. The number `disp`\nmay be any representable integer. Negative displacements shift to the\nright. In any direction, vacant bits are filled with zeros. In particular,\ndisplacements with absolute values higher than 31 result in zero (all bits\nare shifted out). For positive displacements, the following equality holds:\nassert(bit32.lshift(b, disp) == (b * 2^disp) % 2^32)\n lua _G.keys.lua [table]\nContainer for Lua-specific key commands.\n lua _G.snippets.lua [table]\nContainer for Lua-specific snippets.\n lua _m.lua [module]\nThe lua module. It provides utilities for editing Lua code. User tags\nare loaded from _USERHOME/modules/lua/tags and user apis are loaded from\n_USERHOME/modules/lua/api.\n @@ -1209,7 +1215,7 @@ marker_set_back buffer.marker_set_back(buffer, marker_num, color)\nSet the backg marker_set_back_selected buffer.marker_set_back_selected(buffer, marker_num, color)\nSet the background color used for a particular marker number when its folding\nblock is selected.\n@param buffer The global buffer.\n@param marker_num A marker number in the range of `0` to `31`.\n@param color A color in `0xBBGGRR` format. The default color is `#FF0000`.\n marker_set_fore buffer.marker_set_fore(buffer, marker_num, color)\nSet the foreground color used for a particular marker number.\n@param buffer The global buffer.\n@param marker_num A marker number in the range of `0` to `31`.\n@param color A color in `0xBBGGRR` format.\n marker_symbol_defined buffer.marker_symbol_defined(buffer, marker_num)\nReturn the symbol defined for marker_num with `buffer:marker_define()`.\n@param buffer The global buffer.\n@param marker_num A marker number in the range of `0` to `31`.\n@return number\n -match lpeg.match(pattern, subject [, init])\nThe matching function. It attempts to match the given pattern against the\nsubject string. If the match succeeds, returns the index in the subject of\nthe first character after the match, or the captured values (if the pattern\ncaptured any value). An optional numeric argument init makes the match starts\nat that position in the subject string. As usual in Lua libraries, a negative\nvalue counts from the end. Unlike typical pattern-matching functions, match\nworks only in anchored mode; that is, it tries to match the pattern with a\nprefix of the given subject string (at position init), not with an arbitrary\nsubstring of the subject. So, if we want to find a pattern anywhere in a\nstring, we must either write a loop in Lua or write a pattern that matches\nanywhere. This second approach is easy and quite efficient; see examples.\n +match lpeg.match(pattern, subject [, init])\nThe matching function. It attempts to match the given pattern against the\nsubject string. If the match succeeds, returns the index in the subject of\nthe first character after the match, or the captured values (if the pattern\ncaptured any value). An optional numeric argument init makes the match starts\nat that position in the subject string. As usual in Lua libraries, a negative\nvalue counts from the end. Unlike typical pattern-matching functions, match\nworks only in anchored mode; that is, it tries to match the pattern with a\nprefix of the given subject string (at position init), not with an arbitrary\nsubstring of the subject. So, if we want to find a pattern anywhere in a\nstring, we must either write a loop in Lua or write a pattern that matches\nanywhere. This second approach is easy and quite efficient; see examples.\n match string.match(s, pattern [, init])\nLooks for the first *match* of `pattern` in the string `s`. If it finds one,\nthen `match` returns the captures from the pattern; otherwise it returns\nnil. If `pattern` specifies no captures, then the whole match is returned. A\nthird, optional numerical argument `init` specifies where to start the search;\nits default value is 1 and can be negative.\n match_brace _m.textadept.editing.match_brace(select)\nGoes to a matching brace position, selecting the text inside if specified to.\n@param select If `true`, selects the text between matching braces.\n match_case gui.find.match_case [bool]\nSearches are case-sensitive.\n @@ -1217,16 +1223,14 @@ match_case_label_text gui.find.match_case_label_text [string]\nThe text of the ' math _G.math [module]\nLua math module.\n max math.max(x, ···)\nReturns the maximum value among its arguments.\n max_line_state buffer.max_line_state [number]\nThe last line number that has line state. (Read-only)\n -maxn table.maxn(table)\nReturns the largest positive numerical index of the given table, or zero if\nthe table has no positive numerical indices. (To do its job this function\ndoes a linear traversal of the whole table.)\n menu _m.textadept.menu [module]\nProvides dynamic menus for Textadept. This module should be `require`ed last,\nafter `_m.textadept.keys` since it looks up defined key commands to show\nthem in menus.\n menubar _m.textadept.menu.menubar [table]\nContains the main menubar.\n menubar gui.menubar [table]\nA table of GTK menus defining a menubar. (Write-only)\n mime_types _m.textadept.mime_types [module]\nHandles file-specific settings.\n min math.min(x, ···)\nReturns the minimum value among its arguments.\n -mkdir lfs.mkdir(dirname)\nCreates a new directory. The argument is the name of the new directory. Returns\ntrue if the operation was successful; in case of error, it returns nil plus\nan error string.\n +mkdir lfs.mkdir(dirname)\nCreates a new directory. The argument is the name of the new directory.\nReturns true if the operation was successful; in case of error, it returns\nnil plus an error string.\n modf math.modf(x)\nReturns two numbers, the integral part of `x` and the fractional part of `x`.\n modify buffer.modify [bool]\nWhether the document is different from when it was last saved.\n -module _G.module(name [, ···])\nCreates a module. If there is a table in `package.loaded[name]`, this table is\nthe module. Otherwise, if there is a global table `t` with the given name, this\ntable is the module. Otherwise creates a new table `t` and sets it as the value\nof the global `name` and the value of `package.loaded[name]`. This function\nalso initializes `t._NAME` with the given name, `t._M` with the module (`t`\nitself), and `t._PACKAGE` with the package name (the full module name minus\nlast component; see below). Finally, `module` sets `t` as the new environment\nof the current function and the new value of `package.loaded[name]`, so\nthat `require` returns `t`. If `name` is a compound name (that is, one\nwith components separated by dots), `module` creates (or reuses, if they\nalready exist) tables for each component. For instance, if `name` is `a.b.c`,\nthen `module` stores the module table in field `c` of field `b` of global\n`a`. This function can receive optional *options* after the module name,\nwhere each option is a function to be applied over the module.\n mouse_down_captures buffer.mouse_down_captures [bool]\nWhether the mouse is captured when its button is pressed.\n mouse_dwell_time buffer.mouse_dwell_time [number]\nThe time the mouse must sit still to generate a mouse dwell event. If set\nto `_SCINTILLA.constants.SC_TIME_FOREVER`, the default, no dwell events\nare generated.\n move_caret_inside_view buffer.move_caret_inside_view(buffer)\nMove the caret inside current view if it is not there already. Any selection\nis lost.\n@param buffer The global buffer.\n @@ -1239,7 +1243,7 @@ new _m.textadept.adeptsense.new(lang)\nCreates a new Adeptsense for the given le new_buffer _G.new_buffer()\nCreates a new buffer. Generates a `BUFFER_NEW` event.\n@return the new buffer.\n new_line buffer.new_line(buffer)\nInsert a new line, may use a CRLF, CR or LF depending on EOL mode.\n@param buffer The global buffer.\n newline lexer.newline\nMatches any newline characters.\n -next _G.next(table [, index])\nAllows a program to traverse all fields of a table. Its first argument is\na table and its second argument is an index in this table. `next` returns\nthe next index of the table and its associated value. When called with nil\nas its second argument, `next` returns an initial index and its associated\nvalue. When called with the last index, or with nil in an empty table,\n`next` returns nil. If the second argument is absent, then it is interpreted\nas nil. In particular, you can use `next(t)` to check whether a table is\nempty. The order in which the indices are enumerated is not specified, *even\nfor numeric indices*. (To traverse a table in numeric order, use a numerical\nfor or the `ipairs` function.) The behavior of `next` is *undefined* if,\nduring the traversal, you assign any value to a non-existent field in the\ntable. You may however modify existing fields. In particular, you may clear\nexisting fields.\n +next _G.next(table [, index])\nAllows a program to traverse all fields of a table. Its first argument is\na table and its second argument is an index in this table. `next` returns\nthe next index of the table and its associated value. When called with nil\nas its second argument, `next` returns an initial index and its associated\nvalue. When called with the last index, or with nil in an empty table, `next`\nreturns nil. If the second argument is absent, then it is interpreted as\nnil. In particular, you can use `next(t)` to check whether a table is empty.\nThe order in which the indices are enumerated is not specified, *even for\nnumeric indices*. (To traverse a table in numeric order, use a numerical\n`for`.) The behavior of `next` is undefined if, during the traversal,\nyou assign any value to a non-existent field in the table. You may however\nmodify existing fields. In particular, you may clear existing fields.\n next_indic_number _SCINTILLA.next_indic_number()\nReturns a unique indicator number. Use this function for custom indicators\nin order to prevent clashes with identifiers of other custom indicators.\n@usage local indic_num = _SCINTILLA.next_indic_number()\n@see buffer.indic_style\n next_marker_number _SCINTILLA.next_marker_number()\nReturns a unique marker number. Use this function for custom markers in\norder to prevent clashes with identifiers of other custom markers.\n@usage local marknum = _SCINTILLA.next_marker_number()\n@see buffer.marker_define\n next_user_list_type _SCINTILLA.next_user_list_type()\nReturns a unique user list type. Use this function for custom user lists in\norder to prevent clashes with type identifiers of other custom user lists.\n@usage local list_type = _SCINTILLA.next_user_list_type()\n@see buffer.user_list_show\n @@ -1247,12 +1251,13 @@ nonnewline lexer.nonnewline\nMatches any non-newline character.\n nonnewline_esc lexer.nonnewline_esc\nMatches any non-newline character excluding newlines escaped with `\\`.\n oct_num lexer.oct_num\nMatches an octal number.\n open _m.textadept.snapopen.open(utf8_paths, filter, exclusive, depth)\nQuickly open a file in set of directories.\n@param utf8_paths A UTF-8 string directory path or table of UTF-8 directory\npaths to search.\n@param filter A filter for files and folders to exclude. The filter may be\na string or table. Each filter is a Lua pattern. Any files matching a filter\nare excluded. Prefix a pattern with `!` to exclude any files that do not match\nthe filter. Directories can be excluded by adding filters to a table assigned\nto a `folders` key in the filter table. All strings should be UTF-8 encoded.\n@param exclusive Flag indicating whether or not to exclude `PATHS` in the\nsearch. Defaults to `false`.\n@param depth Number of directories to recurse into for finding files. Defaults\nto `DEFAULT_DEPTH`.\n@usage _m.textadept.snapopen.open()\n@usage _m.textadept.snapopen.open(buffer.filename:match('^.+/'), nil, true)\n@usage _m.textadept.snapopen.open(nil, '!%.lua$')\n@usage _m.textadept.snapopen.open(nil, { folders = { '%.hg' } })\n -open io.open(filename [, mode])\nThis function opens a file, in the mode specified in the string `mode`. It\nreturns a new file handle, or, in case of errors, nil plus an error\nmessage. The `mode` string can be any of the following: "r": read mode (the\ndefault); "w": write mode; "a": append mode; "r+": update mode, all previous\ndata is preserved; "w+": update mode, all previous data is erased; "a+":\nappend update mode, previous data is preserved, writing is only allowed at\nthe end of file. The `mode` string can also have a '`b`' at the end, which\nis needed in some systems to open the file in binary mode. This string is\nexactly what is used in the standard C function `fopen`.\n +open io.open(filename [, mode])\nThis function opens a file, in the mode specified in the string `mode`. It\nreturns a new file handle, or, in case of errors, nil plus an error message.\nThe `mode` string can be any of the following: "r": read mode (the default);\n"w": write mode; "a": append mode; "r+": update mode, all previous data is\npreserved; "w+": update mode, all previous data is erased; "a+": append update\nmode, previous data is preserved, writing is only allowed at the end of file.\nThe `mode` string can also have a '`b`' at the end, which is needed in some\nsystems to open the file in binary mode.\n open_file io.open_file(utf8_filenames)\nOpens a list of files.\n@param utf8_filenames A `\\n` separated list of UTF-8-encoded filenames to\nopen. If `nil`, the user is prompted with a fileselect dialog.\n@usage io.open_file(utf8_encoded_filename)\n open_recent_file io.open_recent_file()\nPrompts the user to open a recently opened file.\n os _G.os [module]\nLua os module.\n output io.output([file])\nSimilar to `io.input`, but operates over the default output file.\n overtype buffer.overtype [bool]\nOvertype mode.\n +pack table.pack(···)\nReturns a new table with all parameters stored into keys 1, 2, etc. and with\na field "`n`" with the total number of parameters. Note that the resulting\ntable may not be a sequence.\n package _G.package [module]\nLua package module.\n page_down buffer.page_down(buffer)\nMove caret one page down.\n@param buffer The global buffer.\n page_down_extend buffer.page_down_extend(buffer)\nMove caret one page down extending selection to new caret position.\n@param buffer The global buffer.\n @@ -1260,22 +1265,22 @@ page_down_rect_extend buffer.page_down_rect_extend(buffer)\nMove caret one page page_up buffer.page_up(buffer)\nMove caret one page up.\n@param buffer The global buffer.\n page_up_extend buffer.page_up_extend(buffer)\nMove caret one page up extending selection to new caret position.\n@param buffer The global buffer.\n page_up_rect_extend buffer.page_up_rect_extend(buffer)\nMove caret one page up, extending rectangular selection to new caret position.\n@param buffer The global buffer.\n -pairs _G.pairs(t)\nReturns three values: the `next` function, the table `t`, and nil, so that\nthe construction for k,v in pairs(t) do *body* end will iterate over all\nkey–value pairs of table `t`. See function `next` for the caveats of\nmodifying the table during its traversal.\n +pairs _G.pairs(t)\nIf `t` has a metamethod `__pairs`, calls it with `t` as argument and returns\nthe first three results from the call. Otherwise, returns three values: the\n`next` function, the table `t`, and nil, so that the construction for k,v\nin pairs(t) do *body* end will iterate over all key–value pairs of table\n`t`. See function `next` for the caveats of modifying the table during\nits traversal.\n para_down buffer.para_down(buffer)\nMove caret one paragraph down (delimited by empty lines).\n@param buffer The global buffer.\n para_down_extend buffer.para_down_extend(buffer)\nMove caret one paragraph down (delimited by empty lines) extending selection\nto new caret position.\n@param buffer The global buffer.\n para_up buffer.para_up(buffer)\nMove caret one paragraph up (delimited by empty lines).\n@param buffer The global buffer.\n para_up_extend buffer.para_up_extend(buffer)\nMove caret one paragraph up (delimited by empty lines) extending selection\nto new caret position.\n@param buffer The global buffer.\n paste buffer.paste(buffer)\nPaste the contents of the clipboard into the document replacing the selection.\n@param buffer The global buffer.\n -path package.path\nThe path used by `require` to search for a Lua loader. At start-up,\nLua initializes this variable with the value of the environment variable\n`LUA_PATH` or with a default path defined in `luaconf.h`, if the environment\nvariable is not defined. Any "`;;`" in the value of the environment variable\nis replaced by the default path.\n +path package.path\nThe path used by `require` to search for a Lua loader. At start-up,\nLua initializes this variable with the value of the environment variable\n`LUA_PATH_5_2` or the environment variable `LUA_PATH` or with a default path\ndefined in `luaconf.h`, if those environment variables are not defined. Any\n"`;;`" in the value of the environment variable is replaced by the default\npath.\n patterns _m.textadept.mime_types.patterns [table]\nFirst-line patterns and their associated lexers.\n -pcall _G.pcall(f, arg1, ···)\nCalls function `f` with the given arguments in *protected mode*. This means\nthat any error inside `f` is not propagated; instead, `pcall` catches the\nerror and returns a status code. Its first result is the status code (a\nboolean), which is true if the call succeeds without errors. In such case,\n`pcall` also returns all results from the call, after this first result. In\ncase of any error, `pcall` returns false plus the error message.\n +pcall _G.pcall(f [, arg1, ···])\nCalls function `f` with the given arguments in *protected mode*. This means\nthat any error inside `f` is not propagated; instead, `pcall` catches the\nerror and returns a status code. Its first result is the status code (a\nboolean), which is true if the call succeeds without errors. In such case,\n`pcall` also returns all results from the call, after this first result. In\ncase of any error, `pcall` returns false plus the error message.\n php _G.keys.php [table]\nContainer for PHP-specific key commands.\n php _G.snippets.php [table]\nContainer for PHP-specific snippets.\n php _m.php [module]\nThe php module. It provides utilities for editing PHP code. User tags\nare loaded from _USERHOME/modules/php/tags and user apis are loaded from\n_USERHOME/modules/php/api.\n -pi math.pi\nThe value of *pi*.\n +pi math.pi\nThe value of 'π'.\n point_x_from_position buffer.point_x_from_position(buffer, pos)\nRetrieve the x value of the point in the window where a position is displayed.\n@param buffer The global buffer.\n@param pos The position.\n@return number\n point_y_from_position buffer.point_y_from_position(buffer, pos)\nRetrieve the y value of the point in the window where a position is displayed.\n@param buffer The global buffer.\n@param pos The position.\n@return number\n -popen io.popen(prog [, mode])\nStarts program `prog` in a separated process and returns a file handle that\nyou can use to read data from this program (if `mode` is `"r"`, the default)\nor to write data to this program (if `mode` is `"w"`). This function is\nsystem dependent and is not available on all platforms.\n +popen io.popen(prog [, mode])\nStarts program `prog` in a separated process and returns a file handle that\nyou can use to read data from this program (if `mode` is `"r"`, the default)\nor to write data to this program (if `mode` is `"w"`). This function is\nsystem dependent and is not available on all platforms.\n position_after buffer.position_after(buffer, pos)\nGiven a valid document position, return the next position taking code page\ninto account. Maximum value returned is the last position in the document.\n@param buffer The global buffer.\n@param pos The position.\n position_before buffer.position_before(buffer, pos)\nGiven a valid document position, return the previous position taking code\npage into account. Returns `0` if passed `0`.\n@param buffer The global buffer.\n@param pos The position.\n@return number\n position_cache buffer.position_cache [number]\nThe number of entries in the position cache. The position cache stores\nposition information for short runs of text so that their layout can be\ndetermined more quickly if the run recurs.\n @@ -1283,9 +1288,9 @@ position_from_line buffer.position_from_line(buffer, line)\nRetrieve the positio position_from_point buffer.position_from_point(buffer, x, y)\nFind the position from a point within the window.\n@param buffer The global buffer.\n@return number\n position_from_point_close buffer.position_from_point_close(buffer, x, y)\nReturns the position from a point within the window, but return `-1` if not\nclose to text.\n@param buffer The global buffer.\n@return number\n pow math.pow(x, y)\nReturns *x^y*. (You can also use the expression `x^y` to compute this value.)\n -preload package.preload\nA table to store loaders for specific modules (see `require`).\n +preload package.preload\nA table to store loaders for specific modules (see `require`). This variable\nis only a reference to the real table; assignments to this variable do not\nchange the table used by `require`.\n prepare_for_save _m.textadept.editing.prepare_for_save()\nPrepares the buffer for saving to a file. Strips trailing whitespace off of\nevery line, ensures an ending newline, and converts non-consistent EOLs.\n -print _G.print(···)\nReceives any number of arguments, and prints their values to `stdout`,\nusing the `tostring` function to convert them to strings. `print` is not\nintended for formatted output, but only as a quick way to show a value,\ntypically for debugging. For formatted output, use `string.format`.\n +print _G.print(···)\nReceives any number of arguments and prints their values to `stdout`,\nusing the `tostring` function to convert each argument to a string. `print`\nis not intended for formatted output, but only as a quick way to show a\nvalue, for instance for debugging. For complete control over the output,\nuse `string.format` and `io.write`.\n print gui.print(...)\nPrints messages to the Textadept message buffer. Opens a new buffer (if one\nhas not already been opened) for printing messages.\n@param ... Message strings.\n print lexer.print\nMatches any printable character (space to `~`).\n print_colour_mode buffer.print_colour_mode [number]\nThe print color mode.\n * `_SCINTILLA.constants.SC_PRINT_NORMAL` (0): Print using the current\n screen colors. This is the default.\n * `_SCINTILLA.constants.SC_PRINT_INVERTLIGHT` (1): If you use a dark\n screen background this saves ink by inverting the light value of all\n colors and printing on a white background.\n * `_SCINTILLA.constants.SC_PRINT_BLACKONWHITE` (2): Print all text as\n black on a white background.\n * `_SCINTILLA.constants.SC_PRINT_COLOURONWHITE` (3): Everything prints\n in its own color on a white background.\n * `_SCINTILLA.constants.SC_PRINT_COLOURONWHITEDEFAULTBG` (4):\n Everything prints in its own color on a white background except that\n line numbers use their own background color.\n\n @@ -1304,13 +1309,14 @@ rad math.rad(x)\nReturns the angle `x` (given in degrees) in radians.\n rails _G.keys.rails [table]\nContainer for Rails-specific key commands.\n rails _G.snippets.rails [table]\nContainer for Rails-specific snippets.\n rails _m.rails [module]\nThe rails module. It provides utilities for editing Ruby on Rails code. User\ntags are loaded from _USERHOME/modules/rails/tags and user apis are loaded\nfrom _USERHOME/modules/rails/api.\n -random math.random([m [, n]])\nThis function is an interface to the simple pseudo-random generator function\n`rand` provided by ANSI C. (No guarantees can be given for its statistical\nproperties.) When called without arguments, returns a uniform pseudo-random\nreal number in the range *[0,1)*. When called with an integer number `m`,\n`math.random` returns a uniform pseudo-random integer in the range *[1,\nm]*. When called with two integer numbers `m` and `n`, `math.random` returns\na uniform pseudo-random integer in the range *[m, n]*.\n +random math.random([m [, n]])\nThis function is an interface to the simple pseudo-random generator function\n`rand` provided by Standard C. (No guarantees can be given for its statistical\nproperties.) When called without arguments, returns a uniform pseudo-random\nreal number in the range [0,1). When called with an integer number `m`,\n`math.random` returns a uniform pseudo-random integer in the range [1,\nm]. When called with two integer numbers `m` and `n`, `math.random` returns\na uniform pseudo-random integer in the range [m, n].\n randomseed math.randomseed(x)\nSets `x` as the "seed" for the pseudo-random generator: equal seeds produce\nequal sequences of numbers.\n rawequal _G.rawequal(v1, v2)\nChecks whether `v1` is equal to `v2`, without invoking any metamethod. Returns\na boolean.\n rawget _G.rawget(table, index)\nGets the real value of `table[index]`, without invoking any metamethod. `table`\nmust be a table; `index` may be any value.\n -rawset _G.rawset(table, index, value)\nSets the real value of `table[index]` to `value`, without invoking any\nmetamethod. `table` must be a table, `index` any value different from nil,\nand `value` any Lua value. This function returns `table`.\n -read file:read(···)\nReads the file `file`, according to the given formats, which specify what\nto read. For each format, the function returns a string (or a number)\nwith the characters read, or nil if it cannot read data with the specified\nformat. When called without formats, it uses a default format that reads the\nentire next line (see below). The available formats are "*n": reads a number;\nthis is the only format that returns a number instead of a string. "*a":\nreads the whole file, starting at the current position. On end of file,\nit returns the empty string. "*l": reads the next line (skipping the end of\nline), returning nil on end of file. This is the default format. *number*:\nreads a string with up to this number of characters, returning nil on end\nof file. If number is zero, it reads nothing and returns an empty string,\nor nil on end of file.\n -read io.read(···)\nEquivalent to `io.input():read`.\n +rawlen _G.rawlen(v)\nReturns the length of the object `v`, which must be a table or a string,\nwithout invoking any metamethod. Returns an integer number.\n +rawset _G.rawset(table, index, value)\nSets the real value of `table[index]` to `value`, without invoking any\nmetamethod. `table` must be a table, `index` any value different from nil\nand NaN, and `value` any Lua value. This function returns `table`.\n +read file:read(···)\nReads the file `file`, according to the given formats, which specify what\nto read. For each format, the function returns a string (or a number)\nwith the characters read, or nil if it cannot read data with the specified\nformat. When called without formats, it uses a default format that reads\nthe next line (see below). The available formats are "*n": reads a number;\nthis is the only format that returns a number instead of a string. "*a":\nreads the whole file, starting at the current position. On end of file,\nit returns the empty string. "*l": reads the next line skipping the end\nof line, returning nil on end of file. This is the default format. "*L":\nreads the next line keeping the end of line (if present), returning nil\non end of file. *number*: reads a string with up to this number of bytes,\nreturning nil on end of file. If number is zero, it reads nothing and returns\nan empty string, or nil on end of file.\n +read io.read(···)\nEquivalent to `io.input():read(···)`.\n read_only buffer.read_only [bool]\nRead-only mode.\n rebuild_command_tables _m.textadept.menu.rebuild_command_tables()\nRebuilds the tables used by `select_command()`. This should be called every\ntime `set_menubar()` is called.\n recent_files io.recent_files [table]\nList of recently opened files. The most recent are towards the top.\n @@ -1325,10 +1331,11 @@ register_image buffer.register_image(buffer, type, xpm_data)\nRegister an XPM im register_rgba_image buffer.register_rgba_image(buffer, type, pixels)\nRegister an RGBA image for use in autocompletion lists. It has the width\nand height from `buffer.rgba_image_width` and `buffer.rgba_image_height`.\n@param buffer The global buffer.\n@param type Integer type to register the image with.\n@param pixels RGBA data as is described for\n`buffer:marker_define_rgba_image()`.\n reload buffer.reload(buffer)\nReloads the file in a given buffer.\n@param buffer The global buffer.\n remove _m.textadept.bookmarks.remove()\nClears the bookmark at the current line.\n -remove os.remove(filename)\nDeletes the file or directory with the given name. Directories must be\nempty to be removed. If this function fails, it returns nil, plus a string\ndescribing the error.\n -remove table.remove(table [, pos])\nRemoves from `table` the element at position `pos`, shifting down other\nelements to close the space, if necessary. Returns the value of the removed\nelement. The default value for `pos` is `n`, where `n` is the length of the\ntable, so that a call `table.remove(t)` removes the last element of table `t`.\n -rename os.rename(oldname, newname)\nRenames file or directory named `oldname` to `newname`. If this function\nfails, it returns nil, plus a string describing the error.\n -rep string.rep(s, n)\nReturns a string that is the concatenation of `n` copies of the string `s`.\n +remove os.remove(filename)\nDeletes the file (or empty directory, on POSIX systems) with the given\nname. If this function fails, it returns nil, plus a string describing the\nerror and the error code.\n +remove table.remove(list [, pos])\nRemoves from `list` the element at position `pos`, shifting down the\nelements `list[pos+1], list[pos+2], ···, list[#list]` and erasing element\n`list[#list]`. Returns the value of the removed element. The default value for\n`pos` is `#list`, so that a call `table.remove(t)` removes the last element\nof list `t`.\n +rename os.rename(oldname, newname)\nRenames file or directory named `oldname` to `newname`. If this function\nfails, it returns nil, plus a string describing the error and the error code.\n +rep string.rep(s, n [, sep])\nReturns a string that is the concatenation of `n` copies of the string `s`\nseparated by the string `sep`. The default value for `sep` is the empty string\n(that is, no separator).\n +replace bit32.replace(n, v, field [, width])\nReturns a copy of `n` with the bits `field` to `field + width - 1` replaced\nby the value `v`. See `bit32.extract` for details about `field` and `width`.\n replace gui.find.replace()\nMimicks a press of the 'Replace' button in the Find box.\n replace_all gui.find.replace_all()\nMimicks a press of the 'Replace All' button in the Find box.\n replace_all_button_text gui.find.replace_all_button_text [string]\nThe text of the 'Replace All' button. This is primarily used for\nlocalization. (Write-only)\n @@ -1338,24 +1345,26 @@ replace_label_text gui.find.replace_label_text [string]\nThe text of the 'Replac replace_sel buffer.replace_sel(buffer, text)\nReplace the selected text with the argument text. The caret is positioned\nafter the inserted text and the caret is scrolled into view.\n@param buffer The global buffer.\n@param text The text.\n replace_target buffer.replace_target(buffer, text)\nReplace the target text with the argument text. After replacement, the\ntarget range refers to the replacement text. Returns the length of the\nreplacement text.\n@param buffer The global buffer.\n@param text The text (can contain NULs).\n@return number\n replace_target_re buffer.replace_target_re(buffer, text)\nReplace the target text with the argument text after `\d` processing. Looks\nfor `\d` where `d` is between `1` and `9` and replaces these with the\nstrings matched in the last search operation which were surrounded by `\(`\nand `\)`. Returns the length of the replacement text including any change\ncaused by processing the `\d` patterns.\n@param buffer The global buffer.\n@param text The text (can contain NULs).\n@return number\n -require _G.require(modname)\nLoads the given module. The function starts by looking into the\n`package.loaded` table to determine whether `modname` is already\nloaded. If it is, then `require` returns the value stored at\n`package.loaded[modname]`. Otherwise, it tries to find a *loader* for the\nmodule. To find a loader, `require` is guided by the `package.loaders`\narray. By changing this array, we can change how `require` looks for a\nmodule. The following explanation is based on the default configuration for\n`package.loaders`. First `require` queries `package.preload[modname]`. If it\nhas a value, this value (which should be a function) is the loader. Otherwise\n`require` searches for a Lua loader using the path stored in `package.path`. If\nthat also fails, it searches for a C loader using the path stored in\n`package.cpath`. If that also fails, it tries an *all-in-one* loader (see\n`package.loaders`). Once a loader is found, `require` calls the loader with\na single argument, `modname`. If the loader returns any value, `require`\nassigns the returned value to `package.loaded[modname]`. If the loader returns\nno value and has not assigned any value to `package.loaded[modname]`, then\n`require` assigns true to this entry. In any case, `require` returns the\nfinal value of `package.loaded[modname]`. If there is any error loading or\nrunning the module, or if it cannot find any loader for the module, then\n`require` signals an error.\n +require _G.require(modname)\nLoads the given module. The function starts by looking into the\n`package.loaded` table to determine whether `modname` is already\nloaded. If it is, then `require` returns the value stored at\n`package.loaded[modname]`. Otherwise, it tries to find a *loader* for the\nmodule. To find a loader, `require` is guided by the `package.searchers`\nsequence. By changing this sequence, we can change how `require` looks for a\nmodule. The following explanation is based on the default configuration for\n`package.searchers`. First `require` queries `package.preload[modname]`. If it\nhas a value, this value (which should be a function) is the loader. Otherwise\n`require` searches for a Lua loader using the path stored in `package.path`. If\nthat also fails, it searches for a C loader using the path stored in\n`package.cpath`. If that also fails, it tries an *all-in-one* loader (see\n`package.searchers`). Once a loader is found, `require` calls the loader\nwith two arguments: `modname` and an extra value dependent on how it got the\nloader. (If the loader came from a file, this extra value is the file name.) If\nthe loader returns any non-nil value, `require` assigns the returned value\nto `package.loaded[modname]`. If the loader does not return a non-nil value\nand has not assigned any value to `package.loaded[modname]`, then `require`\nassigns true to this entry. In any case, `require` returns the final\nvalue of `package.loaded[modname]`. If there is any error loading or running\nthe module, or if it cannot find any loader for the module, then `require`\nraises an error.\n reset _G.reset()\nResets the Lua state by reloading all init scripts. Language-specific modules\nfor opened files are NOT reloaded. Re-opening the files that use them will\nreload those modules. This function is useful for modifying init scripts\n(such as the user's `modules/textadept/keys.lua`) on the fly without having\nto restart Textadept. `_G.RESETTING` is set to `true` when re-initing the\nLua State. Any scripts that need to differentiate between startup and reset\ncan utilize this variable.\n -resume coroutine.resume(co [, val1, ···])\nStarts or continues the execution of coroutine `co`. The first time you resume\na coroutine, it starts running its body. The values `val1`, ··· are passed\nas the arguments to the body function. If the coroutine has yielded, `resume`\nrestarts it; the values `val1`, ··· are passed as the results from the\nyield. If the coroutine runs without any errors, `resume` returns true plus\nany values passed to `yield` (if the coroutine yields) or any values returned\nby the body function (if the coroutine terminates). If there is any error,\n`resume` returns false plus the error message.\n +resume coroutine.resume(co [, val1, ···])\nStarts or continues the execution of coroutine `co`. The first time you resume\na coroutine, it starts running its body. The values `val1`, ... are passed\nas the arguments to the body function. If the coroutine has yielded, `resume`\nrestarts it; the values `val1`, ... are passed as the results from the yield.\nIf the coroutine runs without any errors, `resume` returns true plus any\nvalues passed to `yield` (if the coroutine yields) or any values returned\nby the body function (if the coroutine terminates). If there is any error,\n`resume` returns false plus the error message.\n reverse string.reverse(s)\nReturns a string that is the string `s` reversed.\n rgba_image_height buffer.rgba_image_height [number]\nThe height for future RGBA image data.\n rgba_image_width buffer.rgba_image_width [number]\nThe width for future RGBA image data.\n rhtml _G.keys.rhtml [table]\nContainer for RHTML-specific key commands.\n rhtml _G.snippets.rhtml [table]\nContainer for RHTML-specific snippets.\n rhtml _m.rhtml [module]\nThe RHTML module. It provides utilities for editing RHTML. User tags are\nloaded from _USERHOME/modules/rhtml/tags and user apis are loaded from\n_USERHOME/modules/rhtml/api.\n -rmdir lfs.rmdir(dirname)\nRemoves an existing directory. The argument is the name of the\ndirectory. Returns true if the operation was successful; in case of error,\nit returns nil plus an error string.\n +rmdir lfs.rmdir(dirname)\nRemoves an existing directory. The argument is the name of the directory.\nReturns true if the operation was successful; in case of error, it returns\nnil plus an error string.\n rotate_selection buffer.rotate_selection(buffer)\nSet the main selection to the next selection.\n@param buffer The global buffer.\n +rrotate bit32.rrotate(x, disp)\nReturns the number `x` rotated `disp` bits to the right. The number `disp`\nmay be any representable integer. For any valid displacement, the following\nidentity holds: assert(bit32.rrotate(x, disp) == bit32.rrotate(x, disp %\n32)) In particular, negative displacements rotate to the left.\n +rshift bit32.rshift(x, disp)\nReturns the number `x` shifted `disp` bits to the right. The number `disp`\nmay be any representable integer. Negative displacements shift to the\nleft. In any direction, vacant bits are filled with zeros. In particular,\ndisplacements with absolute values higher than 31 result in zero (all bits\nare shifted out). For positive displacements, the following equality holds:\nassert(bit32.rshift(b, disp) == math.floor(b % 2^32 / 2^disp)) This shift\noperation is what is called logical shift.\n ruby _G.keys.ruby [table]\nContainer for Ruby-specific key commands.\n ruby _G.snippets.ruby [table]\nContainer for Ruby-specific snippets.\n ruby _m.ruby [module]\nThe ruby module. It provides utilities for editing Ruby code. User tags\nare loaded from _USERHOME/modules/ruby/tags and user apis are loaded from\n_USERHOME/modules/ruby/api.\n run _m.textadept.run [module]\nModule for running/executing source files. Typically, language-specific\nmodules populate the 'compile_command', 'run_command', and 'error_detail'\ntables for a particular language's file extension.\n run _m.textadept.run.run()\nRuns/executes the file as specified by its extension in the `run_command`\ntable.\n@see run_command\n run_command _m.textadept.run.run_command [table]\nFile extensions and their associated 'go' actions. Each key is a file extension\nwhose value is either a command line string to execute or a function returning\none. This table is typically populated by language-specific modules.\n -running coroutine.running()\nReturns the running coroutine, or nil when called by the main thread.\n +running coroutine.running()\nReturns the running coroutine plus a boolean, true when the running coroutine\nis the main one.\n save _m.textadept.session.save(filename)\nSaves a Textadept session to a file. Saves split views, opened buffers,\ncursor information, and project manager details.\n@param filename The absolute path to the session file to save. Defaults to\neither the current session file or `DEFAULT_SESSION` if not specified.\n@usage _m.textadept.session.save(filename)\n save buffer.save(buffer)\nSaves the current buffer to a file.\n@param buffer The global buffer.\n save_all io.save_all()\nSaves all dirty buffers to their respective files.\n@usage io.save_all()\n @@ -1370,11 +1379,12 @@ search_flags buffer.search_flags [number]\nThe search flags used by `buffer:sear search_in_target buffer.search_in_target(buffer, text)\nSearch for a counted string in the target and set the target to the found\nrange. Returns length of range or `-1` for failure in which case target is\nnot moved.\n@param buffer The global buffer.\n@param text The text (can contain NULs).\n@return number\n search_next buffer.search_next(buffer, flags, text)\nFind some text starting at the search anchor. The return value is `-1` if\nnothing is found, otherwise the return value is the start position of the\nmatching text. The selection is updated to show the matched text, but is\nnot scrolled into view.\n@param buffer The global buffer.\n@param flags Search flags. See `buffer.search_flags`.\n@param text The text.\n@return number\n search_prev buffer.search_prev(buffer, flags, text)\nFind some text starting at the search anchor and moving backwards. The return\nvalue is `-1` if nothing is found, otherwise the return value is the start\nposition of the matching text. The selection is updated to show the matched\ntext, but is not scrolled into view.\n@param buffer The global buffer.\n@param flags Search flags. See `buffer.search_flags`.\n@param text The text.\n@return number\n -seeall package.seeall(module)\nSets a metatable for `module` with its `__index` field referring to the\nglobal environment, so that this module inherits values from the global\nenvironment. To be used as an option to function `module`.\n -seek file:seek([whence] [, offset])\nSets and gets the file position, measured from the beginning of the file,\nto the position given by `offset` plus a base specified by the string\n`whence`, as follows: "set": base is position 0 (beginning of the file);\n"cur": base is current position; "end": base is end of file; In case of\nsuccess, function `seek` returns the final file position, measured in bytes\nfrom the beginning of the file. If this function fails, it returns nil, plus\na string describing the error. The default value for `whence` is `"cur"`, and\nfor `offset` is 0. Therefore, the call `file:seek()` returns the current file\nposition, without changing it; the call `file:seek("set")` sets the position\nto the beginning of the file (and returns 0); and the call `file:seek("end")`\nsets the position to the end of the file, and returns its size.\n +searchers package.searchers\nA table used by `require` to control how to load modules. Each entry in\nthis table is a *searcher function*. When looking for a module, `require`\ncalls each of these searchers in ascending order, with the module name\n(the argument given to `require`) as its sole parameter. The function\ncan return another function (the module *loader*) plus an extra value\nthat will be passed to that loader, or a string explaining why it did not\nfind that module (or nil if it has nothing to say). Lua initializes this\ntable with four functions. The first searcher simply looks for a loader\nin the `package.preload` table. The second searcher looks for a loader\nas a Lua library, using the path stored at `package.path`. The search is\ndone as described in function `package.searchpath`. The third searcher\nlooks for a loader as a C library, using the path given by the variable\n`package.cpath`. Again, the search is done as described in function\n`package.searchpath`. For instance, if the C path is the string\n "./?.so;./?.dll;/usr/local/?/init.so"\nthe searcher for module `foo` will try to open the files `./foo.so`,\n`./foo.dll`, and `/usr/local/foo/init.so`, in that order. Once it finds\na C library, this searcher first uses a dynamic link facility to link the\napplication with the library. Then it tries to find a C function inside the\nlibrary to be used as the loader. The name of this C function is the string\n"`luaopen_`" concatenated with a copy of the module name where each dot is\nreplaced by an underscore. Moreover, if the module name has a hyphen, its\nprefix up to (and including) the first hyphen is removed. For instance, if\nthe module name is `a.v1-b.c`, the function name will be `luaopen_b_c`. The\nfourth searcher tries an *all-in-one loader*. It searches the C path for a\nlibrary for the root name of the given module. For instance, when requiring\n`a.b.c`, it will search for a C library for `a`. If found, it looks into\nit for an open function for the submodule; in our example, that would be\n`luaopen_a_b_c`. With this facility, a package can pack several C submodules\ninto one single library, with each submodule keeping its original open\nfunction. All searchers except the first one (preload) return as the\nextra value the file name where the module was found, as returned by\n`package.searchpath`. The first searcher returns no extra value.\n +searchpath package.searchpath(name, path [, sep [, rep]])\nSearches for the given `name` in the given `path`. A path is a string\ncontaining a sequence of _templates_ separated by semicolons. For each\ntemplate, the function replaces each interrogation mark (if any) in the\ntemplate with a copy of `name` wherein all occurrences of `sep` (a dot,\nby default) were replaced by `rep` (the system's directory separator, by\ndefault), and then tries to open the resulting file name. For instance,\nif the path is the string "./?.lua;./?.lc;/usr/local/?/init.lua" the search\nfor the name `foo.a` will try to open the files `./foo/a.lua`, `./foo/a.lc`,\nand `/usr/local/foo/a/init.lua`, in that order. Returns the resulting name\nof the first file that it can open in read mode (after closing the file),\nor nil plus an error message if none succeeds. (This error message lists\nall file names it tried to open.)\n +seek file:seek([whence [, offset]])\nSets and gets the file position, measured from the beginning of the file, to\nthe position given by `offset` plus a base specified by the string `whence`,\nas follows: "set": base is position 0 (beginning of the file); "cur": base is\ncurrent position; "end": base is end of file; In case of success, function\n`seek` returns the final file position, measured in bytes from the beginning of\nthe file. If `seek` fails, it returns nil, plus a string describing the error.\nThe default value for `whence` is `"cur"`, and for `offset` is 0. Therefore,\nthe call `file:seek()` returns the current file position, without changing it;\nthe call `file:seek("set")` sets the position to the beginning of the file\n(and returns 0); and the call `file:seek("end")` sets the position to the\nend of the file, and returns its size.\n sel_alpha buffer.sel_alpha [number]\nThe alpha of the selection, between `0` (transparent) and `255` (opaque),\nor `256` for no alpha.\n sel_eol_filled buffer.sel_eol_filled [bool]\nThe selection end of line fill. The selection can be drawn up to the right\nhand border by setting this property.\n -select _G.select(index, ···)\nIf `index` is a number, returns all arguments after argument number\n`index`. Otherwise, `index` must be the string `"#"`, and `select` returns\nthe total number of extra arguments it received.\n +select _G.select(index, ···)\nIf `index` is a number, returns all arguments after argument number `index`;\na negative number indexes from the end (-1 is the last argument). Otherwise,\n`index` must be the string `"#"`, and `select` returns the total number of\nextra arguments it received.\n select_all buffer.select_all(buffer)\nSelect all the text in the document. The current position is not scrolled\ninto view.\n@param buffer The global buffer.\n select_command _m.textadept.menu.select_command()\nPrompts the user with a filteredlist to run menu commands.\n select_enclosed _m.textadept.editing.select_enclosed(left, right)\nSelects text between a given pair of strings.\n@param left The left part of the enclosure.\n@param right The right part of the enclosure.\n @@ -1439,17 +1449,16 @@ set_whitespace_back buffer.set_whitespace_back(buffer, use_setting, color)\nSet set_whitespace_fore buffer.set_whitespace_fore(buffer, use_setting, color)\nSet the foreground color of all whitespace and whether to use this setting.\n@param buffer The global buffer.\n@param use_setting Enable color change.\n@param color A color in `0xBBGGRR` format.\n set_x_caret_policy buffer.set_x_caret_policy(buffer, caret_policy, caret_slop)\nSet the way the caret is kept visible when going sideway. The exclusion zone\nis given in pixels.\n@param buffer The global buffer.\n@param caret_policy A combination of `_SCINTILLA.constants.CARET_SLOP` (0x01),\n`_SCINTILLA.constants.CARET_STRICT` (0x04), `_SCINTILLA.constants.CARET_JUMPS`\n(0x10), and `_SCINTILLA.constants.CARET_EVEN` (0x08).\n@param caret_slop A slop value.\n set_y_caret_policy buffer.set_y_caret_policy(buffer, caret_policy, caret_slop)\nSet the way the line the caret is on is kept visible.\n@param buffer The global buffer.\n@param caret_policy A combination of `_SCINTILLA.constants.CARET_SLOP` (0x01),\n`_SCINTILLA.constants.CARET_STRICT` (0x04), `_SCINTILLA.constants.CARET_JUMPS`\n(0x10), and `_SCINTILLA.constants.CARET_EVEN` (0x08).\n@param caret_slop A slop value.\n -setfenv _G.setfenv(f, table)\nSets the environment to be used by the given function. `f` can be a Lua\nfunction or a number that specifies the function at that stack level: Level 1\nis the function calling `setfenv`. `setfenv` returns the given function. As a\nspecial case, when `f` is 0 `setfenv` changes the environment of the running\nthread. In this case, `setfenv` returns no values.\n -setfenv debug.setfenv(object, table)\nSets the environment of the given `object` to the given `table`. Returns\n`object`.\n -sethook debug.sethook([thread, ] hook, mask [, count])\nSets the given function as a hook. The string `mask` and the number `count`\ndescribe when the hook will be called. The string mask may have the following\ncharacters, with the given meaning: `"c"`: the hook is called every time\nLua calls a function; `"r"`: the hook is called every time Lua returns from\na function; `"l"`: the hook is called every time Lua enters a new line of\ncode. With a `count` different from zero, the hook is called after every\n`count` instructions. When called without arguments, `debug.sethook` turns\noff the hook. When the hook is called, its first parameter is a string\ndescribing the event that has triggered its call: `"call"`, `"return"`\n(or `"tail return"`, when simulating a return from a tail call), `"line"`,\nand `"count"`. For line events, the hook also gets the new line number as\nits second parameter. Inside a hook, you can call `getinfo` with level 2 to\nget more information about the running function (level 0 is the `getinfo`\nfunction, and level 1 is the hook function), unless the event is `"tail\nreturn"`. In this case, Lua is only simulating the return, and a call to\n`getinfo` will return invalid data.\n -setlocal debug.setlocal([thread, ] level, local, value)\nThis function assigns the value `value` to the local variable with index\n`local` of the function at level `level` of the stack. The function returns nil\nif there is no local variable with the given index, and raises an error when\ncalled with a `level` out of range. (You can call `getinfo` to check whether\nthe level is valid.) Otherwise, it returns the name of the local variable.\n -setlocale os.setlocale(locale [, category])\nSets the current locale of the program. `locale` is a string specifying a\nlocale; `category` is an optional string describing which category to change:\n`"all"`, `"collate"`, `"ctype"`, `"monetary"`, `"numeric"`, or `"time"`; the\ndefault category is `"all"`. The function returns the name of the new locale,\nor nil if the request cannot be honored. If `locale` is the empty string,\nthe current locale is set to an implementation-defined native locale. If\n`locale` is the string "`C`", the current locale is set to the standard\nC locale. When called with nil as the first argument, this function only\nreturns the name of the current locale for the given category.\n +sethook debug.sethook([thread, ] hook, mask [, count])\nSets the given function as a hook. The string `mask` and the number `count`\ndescribe when the hook will be called. The string mask may have the following\ncharacters, with the given meaning: "c": the hook is called every time Lua\ncalls a function; "r": the hook is called every time Lua returns from a\nfunction; "l": the hook is called every time Lua enters a new line of code.\nWith a `count` different from zero, the hook is called after every `count`\ninstructions. When called without arguments, `debug.sethook` turns off the\nhook. When the hook is called, its first parameter is a string describing the\nevent that has triggered its call: `"call"` (or `"tail call"`), `"return"`,\n`"line"`, and `"count"`. For line events, the hook also gets the new line\nnumber as its second parameter. Inside a hook, you can call `getinfo` with\nlevel 2 to get more information about the running function (level 0 is the\n`getinfo` function, and level 1 is the hook function).\n +setlocal debug.setlocal([thread, ] level, local, value)\nThis function assigns the value `value` to the local variable with index\n`local` of the function at level `level` of the stack. The function returns nil\nif there is no local variable with the given index, and raises an error when\ncalled with a `level` out of range. (You can call `getinfo` to check whether\nthe level is valid.) Otherwise, it returns the name of the local variable.\nSee `debug.getlocal` for more information about variable indices and names.\n +setlocale os.setlocale(locale [, category])\nSets the current locale of the program. `locale` is a system-dependent string\nspecifying a locale; `category` is an optional string describing which category\nto change: `"all"`, `"collate"`, `"ctype"`, `"monetary"`, `"numeric"`, or\n`"time"`; the default category is `"all"`. The function returns the name\nof the new locale, or nil if the request cannot be honored. If `locale`\nis the empty string, the current locale is set to an implementation-defined\nnative locale. If `locale` is the string "`C`", the current locale is set\nto the standard C locale. When called with nil as the first argument, this\nfunction only returns the name of the current locale for the given category.\n setmaxstack lpeg.setmaxstack(max)\nSets the maximum size for the backtrack stack used by LPeg to track calls\nand choices. Most well-written patterns need little backtrack levels and\ntherefore you seldom need to change this maximum; but a few useful patterns\nmay need more space. Before changing this maximum you should try to rewrite\nyour pattern to avoid the need for extra space.\n -setmetatable _G.setmetatable(table, metatable)\nSets the metatable for the given table. (You cannot change the metatable\nof other types from Lua, only from C.) If `metatable` is nil, removes the\nmetatable of the given table. If the original metatable has a `"__metatable"`\nfield, raises an error. This function returns `table`.\n -setmetatable debug.setmetatable(object, table)\nSets the metatable for the given `object` to the given `table` (which can\nbe nil).\n +setmetatable _G.setmetatable(table, metatable)\nSets the metatable for the given table. (You cannot change the metatable\nof other types from Lua, only from C.) If `metatable` is nil, removes the\nmetatable of the given table. If the original metatable has a `"__metatable"`\nfield, raises an error. This function returns `table`.\n +setmetatable debug.setmetatable(value, table)\nSets the metatable for the given `value` to the given `table` (which can\nbe nil).\n setmode lfs.setmode(file, mode)\nSets the writing mode for a file. The mode string can be either binary or\ntext. Returns the previous mode string for the file. This function is only\navailable in Windows, so you may want to make sure that lfs.setmode exists\nbefore using it.\n -setupvalue debug.setupvalue(func, up, value)\nThis function assigns the value `value` to the upvalue with index `up` of\nthe function `func`. The function returns nil if there is no upvalue with\nthe given index. Otherwise, it returns the name of the upvalue.\n -setvbuf file:setvbuf(mode [, size])\nSets the buffering mode for an output file. There are three available\nmodes: "no": no buffering; the result of any output operation appears\nimmediately. "full": full buffering; output operation is performed only\nwhen the buffer is full (or when you explicitly `flush` the file (see\n`io.flush`)). "line": line buffering; output is buffered until a newline is\noutput or there is any input from some special files (such as a terminal\ndevice). For the last two cases, `size` specifies the size of the buffer,\nin bytes. The default is an appropriate size.\n +setupvalue debug.setupvalue(f, up, value)\nThis function assigns the value `value` to the upvalue with index `up` of\nthe function `f`. The function returns nil if there is no upvalue with the\ngiven index. Otherwise, it returns the name of the upvalue.\n +setuservalue debug.setuservalue(udata, value)\nSets the given `value` as the Lua value associated to the given\n`udata`. `value` must be a table or nil; `udata` must be a full userdata.\nReturns `udata`.\n +setvbuf file:setvbuf(mode [, size])\nSets the buffering mode for an output file. There are three available\nmodes: "no": no buffering; the result of any output operation appears\nimmediately. "full": full buffering; output operation is performed only\nwhen the buffer is full or when you explicitly `flush` the file (see\n`io.flush`). "line": line buffering; output is buffered until a newline is\noutput or there is any input from some special files (such as a terminal\ndevice). For the last two cases, `size` specifies the size of the buffer,\nin bytes. The default is an appropriate size.\n shebangs _m.textadept.mime_types.shebangs [table]\nShebang words and their associated lexers.\n show_apidoc _m.textadept.adeptsense.show_apidoc(sense)\nShows a calltip with API documentation for the symbol behind the caret.\n@param sense The Adeptsense returned by `adeptsense.new()`.\n@return `true` on success or `false`.\n@see get_symbol\n@see get_apidoc\n show_documentation _m.textadept.adeptsense.show_documentation()\nShows API documentation for the symbol at the current position based on the\ncurrent lexer's Adeptsense. This should be called by key commands and menus\ninstead of `show_apidoc()`.\n @@ -1462,7 +1471,7 @@ size view.size [number]\nThe position of the split resizer (if this view is part snapopen _m.textadept.snapopen [module]\nSnapopen for the textadept module.\n snippets _G.snippets [table]\nProvides access to snippets from `_G`.\n snippets _m.textadept.snippets [module]\nProvides Lua-style snippets for Textadept.\n -sort table.sort(table [, comp])\nSorts table elements in a given order, *in-place*, from `table[1]` to\n`table[n]`, where `n` is the length of the table. If `comp` is given, then it\nmust be a function that receives two table elements, and returns true when the\nfirst is less than the second (so that `not comp(a[i+1],a[i])` will be true\nafter the sort). If `comp` is not given, then the standard Lua operator `<`\nis used instead. The sort algorithm is not stable; that is, elements considered\nequal by the given order may have their relative positions changed by the sort.\n +sort table.sort(list [, comp])\nSorts list elements in a given order, *in-place*, from `list[1]` to\n`list[#list]`. If `comp` is given, then it must be a function that receives\ntwo list elements and returns true when the first element must come before the\nsecond in the final order (so that `not comp(list[i+1],list[i])` will be true\nafter the sort). If `comp` is not given, then the standard Lua operator `<` is\nused instead. The sort algorithm is not stable; that is, elements considered\nequal by the given order may have their relative positions changed by the sort.\n space lexer.space\nMatches any whitespace character (`\t`, `\v`, `\f`, `\\n`, `\r`, space).\n split view:split(vertical)\nSplits the indexed view vertically or horizontally and focuses the new view.\n@param vertical Flag indicating a vertical split. Defaults to `false`\nfor horizontal.\n@return old view and new view tables.\n sqrt math.sqrt(x)\nReturns the square root of `x`. (You can also use the expression `x^0.5`\nto compute this value.)\n @@ -1522,7 +1531,7 @@ style_underline buffer.style_underline [table]\nTable of booleans for underlined style_variable lexer.style_variable\nTypically used for variables.\n style_visible buffer.style_visible [table]\nTable of booleans for visible styles from `0` to `255`.\n style_weight buffer.style_weight [table]\nTable of character weights for styles from `0` to `255`. The weight or\nboldness of a font can be set with a number between 1 and 999 with 1 being\nvery light and 999 very heavy. While any value can be used, fonts often only\nsupport between 2 and 4 weights with three weights being common enough to\nuse symbolic names:\n * `_SCINTILLA.constants.SC_WEIGHT_NORMAL` (400): Normal.\n * `_SCINTILLA.constants.SC_WEIGHT_SEMIBOLD` (600): Semi-bold.\n * `_SCINTILLA.constants.SC_WEIGHT_BOLD` (700): Bold.\n\n -sub string.sub(s, i [, j])\nReturns the substring of `s` that starts at `i` and continues until `j`;\n`i` and `j` can be negative. If `j` is absent, then it is assumed to\nbe equal to -1 (which is the same as the string length). In particular,\nthe call `string.sub(s,1,j)` returns a prefix of `s` with length `j`, and\n`string.sub(s, -i)` returns a suffix of `s` with length `i`.\n +sub string.sub(s, i [, j])\nReturns the substring of `s` that starts at `i` and continues until `j`;\n`i` and `j` can be negative. If `j` is absent, then it is assumed to\nbe equal to -1 (which is the same as the string length). In particular,\nthe call `string.sub(s,1,j)` returns a prefix of `s` with length `j`, and\n`string.sub(s, -i)` returns a suffix of `s` with length `i`. If, after the\ntranslation of negative indices, `i` is less than 1, it is corrected to 1. If\n`j` is greater than the string length, it is corrected to that length. If,\nafter these corrections, `i` is greater than `j`, the function returns the\nempty string.\n swap_main_anchor_caret buffer.swap_main_anchor_caret(buffer)\nSwap that caret and anchor of the main selection.\n@param buffer The global buffer.\n switch_buffer gui.switch_buffer()\nDisplays a dialog with a list of buffers to switch to and switches to the\nselected one, if any.\n symbol_chars _m.textadept.adeptsense.syntax.symbol_chars\nA Lua pattern of characters allowed in a symbol, including member\noperators. The pattern should be a character set. The default is `'[%w_%.]'`.\n @@ -1543,20 +1552,20 @@ text_length buffer.text_length [number]\nThe number of characters in the documen text_range buffer.text_range(buffer, start_pos, end_pos)\nGets a range of text from the current buffer.\n@param buffer The global buffer.\n@param start_pos The beginning position of the range of text to get.\n@param end_pos The end position of the range of text to get.\n text_width buffer.text_width(buffer, style_num, text)\nMeasure the pixel width of some text in a particular style. Does not handle\ntab or control characters.\n@param buffer The global buffer.\n@param style_num The style number between `0` and `255`.\n@param text The text.\n@return number\n textadept _m.textadept [module]\nThe textadept module. It provides utilities for editing text in Textadept.\n -time os.time([table])\nReturns the current time when called without arguments, or a time representing\nthe date and time specified by the given table. This table must have fields\n`year`, `month`, and `day`, and may have fields `hour`, `min`, `sec`, and\n`isdst` (for a description of these fields, see the `os.date` function). The\nreturned value is a number, whose meaning depends on your system. In POSIX,\nWindows, and some other systems, this number counts the number of seconds\nsince some given start time (the "epoch"). In other systems, the meaning\nis not specified, and the number returned by `time` can be used only as an\nargument to `date` and `difftime`.\n +time os.time([table])\nReturns the current time when called without arguments, or a time representing\nthe date and time specified by the given table. This table must have fields\n`year`, `month`, and `day`, and may have fields `hour` (default is 12), `min`\n(default is 0), `sec` (default is 0), and `isdst` (default is nil). For\na description of these fields, see the `os.date` function. The returned\nvalue is a number, whose meaning depends on your system. In POSIX, Windows,\nand some other systems, this number counts the number of seconds since some\ngiven start time (the "epoch"). In other systems, the meaning is not specified,\nand the number returned by `time` can be used only as an argument to `os.date`\nand `os.difftime`.\n timeout _G.timeout(interval, f, ...)\nCalls a given function after an interval of time. To repeatedly call the\nfunction, return true inside the function. A `nil` or `false` return value\nstops repetition.\n@param interval The interval in seconds to call the function after.\n@param f The function to call.\n@param ... Additional arguments to pass to `f`.\n title gui.title [string]\nThe title of the Textadept window.\n tmpfile io.tmpfile()\nReturns a handle for a temporary file. This file is opened in update mode\nand it is automatically removed when the program ends.\n -tmpname os.tmpname()\nReturns a string with a file name that can be used for a temporary file. The\nfile must be explicitly opened before its use and explicitly removed when\nno longer needed. On some systems (POSIX), this function also creates a file\nwith that name, to avoid security risks. (Someone else might create the file\nwith wrong permissions in the time between getting the name and creating\nthe file.) You still have to open the file to use it and to remove it (even\nif you do not use it). When possible, you may prefer to use `io.tmpfile`,\nwhich automatically removes the file when the program ends.\n +tmpname os.tmpname()\nReturns a string with a file name that can be used for a temporary file. The\nfile must be explicitly opened before its use and explicitly removed when\nno longer needed. On POSIX systems, this function also creates a file with\nthat name, to avoid security risks. (Someone else might create the file\nwith wrong permissions in the time between getting the name and creating\nthe file.) You still have to open the file to use it and to remove it (even\nif you do not use it). When possible, you may prefer to use `io.tmpfile`,\nwhich automatically removes the file when the program ends.\n toggle _m.textadept.bookmarks.toggle()\nToggles a bookmark on the current line.\n toggle_block _m.ruby.toggle_block()\nToggles between { ... } and do ... end Ruby blocks. If the caret is inside\na { ... } single-line block, that block is converted to a multiple-line do\n.. end block. If the caret is on a line that contains single-line do ... end\nblock, that block is converted to a single-line { ... } block. If the caret\nis inside a multiple-line do ... end block, that block is converted to a\nsingle-line { ... } block with all newlines replaced by a space. Indentation\nis important. The 'do' and 'end' keywords must be on lines with the same\nlevel of indentation to toggle correctly\n toggle_caret_sticky buffer.toggle_caret_sticky(buffer)\nSwitch between sticky and non-sticky: meant to be bound to a key. See\n`buffer.caret_sticky`.\n@param buffer The global buffer.\n toggle_fold buffer.toggle_fold(buffer, line)\nSwitch a header line between expanded and contracted.\n@param buffer The global buffer.\n@param line The line number.\n token lexer.token(name, patt)\nCreates an LPeg capture table index with the name and position of the token.\n@param name The name of token. If this name is not in `l.tokens` then you\nwill have to specify a style for it in `lexer._tokenstyles`.\n@param patt The LPeg pattern associated with the token.\n@usage local ws = token(l.WHITESPACE, l.space^1)\n@usage php_start_rule = token('php_tag', '