diff options
Diffstat (limited to 'modules/lua')
-rw-r--r-- | modules/lua/api | 12 | ||||
-rw-r--r-- | modules/lua/tags | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/modules/lua/api b/modules/lua/api index e893b4a2..94fe310c 100644 --- a/modules/lua/api +++ b/modules/lua/api @@ -333,7 +333,7 @@ _SCINTILLA _G._SCINTILLA (module)\nScintilla constants, functions, and propertie _USERHOME _G._USERHOME (string)\nThe path to the user's *~/.textadept/* directory, where all preferences and\nuser-data is stored.\nOn Windows machines *~/* is the value of the "USERHOME" environment\nvariable (typically *C:\Users\username\\* or\n*C:\Documents and Settings\username\\*). On Linux, BSD, and Mac OSX\nmachines *~/* is the value of "$HOME" (typically */home/username/* and\n*/Users/username/* respectively). _VERSION _G._VERSION (string)\nA global variable (not a function) that holds a string containing the\nrunning Lua version. The current value of this variable is "`Lua 5.3`". _VIEWS _G._VIEWS (table)\nTable of all views in Textadept.\nNumeric keys have view values and view keys have their associated numeric\nkeys.\n@see _G.view -_cancel_current textadept.snippets._cancel_current()\nCancels the active snippet, removing all inserted text. +_cancel_current textadept.snippets._cancel_current()\nCancels the active snippet, removing all inserted text.\nReturns `false` if no snippet is active.\n@return `false` if no snippet is active; `nil` otherwise. _fold lexer.lexer._fold (table)\nIf this function exists in the lexer, it is called for folding\n the document instead of using `_foldsymbols` or indentation. _foldsymbols lexer.lexer._foldsymbols (table)\nA table of recognized fold points for the lexer.\n Keys are token names with table values defining fold points. Those table\n values have string keys of keywords or characters that indicate a fold\n point whose values are integers. A value of `1` indicates a beginning fold\n point and a value of `-1` indicates an ending fold point. Values can also\n be functions that return `1`, `-1`, or `0` (indicating no fold point) for\n keys which need additional processing.\n There is also a required `_patterns` key whose value is a table containing\n Lua pattern strings that match all fold points (the string keys contained\n in token name table values). When the lexer encounters text that matches\n one of those patterns, the matched text is looked up in its token's table\n to determine whether or not it is a fold point.\n There is also an optional `_case_insensitive` option that indicates whether\n or not fold point keys are case-insensitive. If `true`, fold point keys\n should be in lower case. _insert textadept.snippets._insert(text)\nInserts snippet text *text* or the snippet assigned to the trigger word\nbehind the caret.\nOtherwise, if a snippet is active, goes to the active snippet's next\nplaceholder. Returns `false` if no action was taken.\n@param text Optional snippet text to insert. If `nil`, attempts to insert a\n new snippet based on the trigger, the word behind caret, and the current\n lexer.\n@return `false` if no action was taken; `nil` otherwise.\n@see buffer.word_chars @@ -445,6 +445,7 @@ cancel buffer.cancel(buffer)\nCancels the active selection mode, autocompletion caret_fore buffer.caret_fore (number)\nThe caret's foreground color, in "0xBBGGRR" format. caret_line_back buffer.caret_line_back (number)\nThe background color, in "0xBBGGRR" format, of the line that contains the\ncaret. caret_line_back_alpha buffer.caret_line_back_alpha (number)\nThe caret line's background alpha value, ranging from `0` (transparent) to\n`255` (opaque).\nThe default value is `buffer.ALPHA_NOALPHA`, for no alpha. +caret_line_frame buffer.caret_line_frame (number)\nThe caret line's frame width in pixels.\nWhen non-zero, the line that contains the caret is framed instead of \ncolored in. The `buffer.caret_line_back` and `buffer.caret_line_back_alpha`\nproperties apply to the frame.\nThe default value is `0`. caret_line_visible buffer.caret_line_visible (bool)\nColor the background of the line that contains the caret a different color.\nThe default value is `false`. caret_line_visible_always buffer.caret_line_visible_always (bool)\nAlways show the caret line, even when the window is not in focus.\nThe default value is `false`, showing the line only when the window is in\nfocus. caret_period buffer.caret_period (number)\nThe time between caret blinks in milliseconds.\nA value of `0` stops blinking.\nThe default value is `500`. @@ -482,6 +483,7 @@ cntrl lexer.cntrl (pattern)\nA pattern that matches any control character (ASCII codepoint utf8.codepoint(s [, i [, j]])\nReturns the codepoints (as integers) from all characters in `s` that start\nbetween byte position `i` and `j` (both included). The default for `i` is 1\nand for `j` is `i`. It raises an error if it meets any invalid byte sequence.\n\nNew in Lua 5.3. codes utf8.codes(s)\nReturns values so that the construction\n\n for p, c in utf8.codes(s) do *body* end\n\nwill iterate over all characters in string `s`, with `p` being the position\n(in bytes) and `c` the code point of each character. It raises an error if it\nmeets any invalid byte sequence.\n\nNew in Lua 5.3. 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\n option.\n "stop": stops automatic execution of the garbage collector.\n "restart": restarts automatic execution of the garbage collector.\n "count": returns the total memory in use by Lua in Kbytes. The value has a\n fractional part, so that it multiplied by 1024 gives the exact\n number of bytes in use by Lua (except for overflows).\n "step": performs a garbage-collection step. The step "size" is controlled\n by `arg`. With a zero value, the collector will perform one basic\n (indivisible) step. For non-zero values, the collector will perform\n as if that amount of memory (in KBytes) had been allocated by Lua.\n Returns true if the step finished a collection cycle.\n "setpause": sets `arg` as the new value for the *pause* of the collector\n (see §2.5). Returns the previous value for *pause*.\n "setstepmul": sets `arg` as the new value for the *step multiplier*\n of the collector (see §2.5). Returns the previous value for\n *step*.\n "isrunning": returns a boolean that tells whether the collector is running\n (i.e., not stopped). +colorselect ui.dialogs.colorselect(options)\nPrompts the user with a color selection dialog defined by dialog options\ntable *options*, returning the color selected.\nIf the user canceled the dialog, returns `nil`.\n@param options Table of key-value option pairs for the option select dialog.\n\n * `title`: The dialog's title text.\n * `color`: The initially selected color as either a number in "0xBBGGRR"\n format, or as a string in "#RRGGBB" format.\n * `palette`: The list of colors to show in the dialog's color palette.\n Up to 20 colors can be specified as either numbers in "0xBBGGRR" format\n or as strings in "#RRGGBB" format. If `true` (no list was given), a\n default palette is shown.\n * `string_output`: Return the selected color in string "#RRGGBB" format\n instead of numeric "0xBBGGRR" format. The default value is `false`.\n * `float`: Show the dialog on top of all desktop windows. The default value\n is `false`.\n@usage ui.dialogs.colorselect{title = 'Foreground color', color = 0x000000,\n palette = {'#000000', 0x0000FF, '#00FF00', 0xFF0000}}\n@return selected color colourise buffer.colourise(buffer, start_pos, end_pos)\nInstructs the lexer to style and mark fold points in the range of text\nbetween *start_pos* and *end_pos*.\nIf *end_pos* is `-1`, styles and marks to the end of the buffer.\n@param buffer A buffer.\n@param start_pos The start position of the range of text in *buffer* to\n process.\n@param end_pos The end position of the range of text in *buffer* to process,\n or `-1` to process from *start_pos* to the end of *buffer*. column buffer.column (table, Read-only)\nTable of column numbers (taking tab widths into account) for positions\nstarting from zero.\nMulti-byte characters count as single characters. command_entry ui.command_entry (module)\nTextadept's Command Entry. @@ -537,7 +539,7 @@ dialogs ui.dialogs (module)\nProvides a set of interactive dialog prompts for us difftime os.difftime(t2, t1)\nReturns the difference, in seconds, from time `t1` to time `t2` (where the\ntimes are values returned by `os.time`). In POSIX, Windows, and some other\nsystems, this value is exactly `t2`*-*`t1`. digit lexer.digit (pattern)\nA pattern that matches any digit ('0'-'9'). dir lfs.dir(path)\nLua iterator over the entries of a given directory. Each time the iterator is\ncalled with dir_obj it returns a directory entry's name as a string, or nil\nif there are no more entries. You can also iterate by calling dir_obj:next(),\nand explicitly close the directory before the iteration finished with\ndir_obj:close(). Raises an error if path is not a directory. -dir_foreach lfs.dir_foreach(dir, f, filter, n, include_dirs, level)\nIterates over all files and sub-directories (up to *n* levels deep) in\ndirectory *dir*, calling function *f* with each file found.\nFiles passed to *f* do not match any pattern in string or table *filter*\n(or `lfs.default_filter` when *filter* is `nil`). A filter table contains:\n\n + Lua patterns that match filenames to exclude.\n + Optional `folders` sub-table that contains patterns matching directories\n to exclude.\n + Optional `extensions` sub-table that contains raw file extensions to\n exclude.\n + Optional `symlink` flag that when `true`, excludes symlinked files (but\n not symlinked directories).\n + Optional `folders.symlink` flag that when `true`, excludes symlinked\n directories.\n\nAny filter patterns starting with '!' exclude files and directories that do\nnot match the pattern that follows.\n@param dir The directory path to iterate over.\n@param f Function to call with each full file path found. If *f* returns\n `false` explicitly, iteration ceases.\n@param filter Optional filter for files and directories to exclude. The\n default value is `lfs.default_filter`.\n@param n Optional maximum number of directory levels to descend into.\n The default value is `nil`, which indicates no limit.\n@param include_dirs Optional flag indicating whether or not to call *f* with\n directory names too. Directory names are passed with a trailing '/' or '\',\n depending on the current platform.\n The default value is `false`.\n@param level Utility value indicating the directory level this function is\n at. This value is used and set internally, and should not be set otherwise.\n@see filter +dir_foreach lfs.dir_foreach(dir, f, filter, n, include_dirs, level)\nIterates over all files and sub-directories (up to *n* levels deep) in\ndirectory *dir*, calling function *f* with each file found.\nFiles passed to *f* do not match any pattern in string or table *filter*\n(or `lfs.default_filter` when *filter* is `nil`). A filter table contains:\n\n + Lua patterns that match filenames to exclude.\n + Optional `folders` sub-table that contains patterns matching directories\n to exclude.\n + Optional `extensions` sub-table that contains raw file extensions to\n exclude.\n + Optional `symlink` flag that when `true`, excludes symlinked files (but\n not symlinked directories).\n + Optional `folders.symlink` flag that when `true`, excludes symlinked\n directories.\n\nAny filter patterns starting with '!' include files and directories that\nmatch the pattern that follows. This is useful for filtering out all files\nand directories except a select few.\n@param dir The directory path to iterate over.\n@param f Function to call with each full file path found. If *f* returns\n `false` explicitly, iteration ceases.\n@param filter Optional filter for files and directories to exclude. The\n default value is `lfs.default_filter`.\n@param n Optional maximum number of directory levels to descend into.\n The default value is `nil`, which indicates no limit.\n@param include_dirs Optional flag indicating whether or not to call *f* with\n directory names too. Directory names are passed with a trailing '/' or '\',\n depending on the current platform.\n The default value is `false`.\n@param level Utility value indicating the directory level this function is\n at. This value is used and set internally, and should not be set otherwise.\n@see filter disconnect events.disconnect(event, f)\nRemoves function *f* from the set of handlers for event *event*.\n@param event The string event name.\n@param f The Lua function connected to *event*.\n@see connect doc_line_from_visible buffer.doc_line_from_visible(buffer, display_line)\nReturns the actual line number of displayed line number *display_line*,\ntaking hidden lines into account.\nIf *display_line* is less than or equal to zero, returns `0`. If\n*display_line* is greater than or equal to the number of displayed lines,\nreturns `buffer.line_count`.\n@param buffer A buffer.\n@param display_line The display line number to use.\n@return number document_end buffer.document_end(buffer)\nMoves the caret to the end of the buffer.\n@param buffer A buffer. @@ -620,6 +622,7 @@ fold_level lexer.fold_level (table, Read-only)\nTable of fold level bit-masks fo fold_line buffer.fold_line(buffer, line, action)\nContracts, expands, or toggles the fold point on line number *line*,\ndepending on *action*.\n@param buffer A buffer.\n@param line The line number in *buffer* to set the fold state for.\n@param action The fold action to perform. Valid values are:\n * `buffer.FOLDACTION_CONTRACT`\n * `buffer.FOLDACTION_EXPAND`\n * `buffer.FOLDACTION_TOGGLE` fold_line_comments lexer.fold_line_comments(prefix)\nReturns a fold function (to be used within the lexer's `_foldsymbols` table)\nthat folds consecutive line comments that start with string *prefix*.\n@param prefix The prefix string defining a line comment.\n@usage [l.COMMENT] = {['--'] = l.fold_line_comments('--')}\n@usage [l.COMMENT] = {['//'] = l.fold_line_comments('//')} fold_parent buffer.fold_parent (table, Read-only)\nTable of fold point line numbers for child line numbers starting from zero.\nA line number of `-1` means no line was found. +fontselect ui.dialogs.fontselect(options)\nPrompts the user with a font selection dialog defined by dialog options\ntable *options*, returning the font selected (including style and size).\nIf the user canceled the dialog, returns `nil`.\n@param options Table of key-value option pairs for the option select dialog.\n\n * `title`: The dialog's title text.\n * `text`: The font preview text.\n * `font-name`: The initially selected font name.\n * `font-size`: The initially selected font size. The default value is `12`.\n * `font-style`: The initially selected font style. The available options\n are `"regular"`, `"bold"`, `"italic"`, and `"bold italic"`. The default\n value is `"regular"`.\n * `float`: Show the dialog on top of all desktop windows. The default value\n is `false`.\n@usage ui.dialogs.fontselect{title = 'Font', font_name = 'Monospace',\n font_size = 10}\n@return selected font, including style and size format string.format(formatstring, ···)\nReturns a formatted version of its variable number of arguments following the\ndescription given in its first argument (which must be a string). The format\nstring follows the same rules as the ISO C function `sprintf`. The only\ndifferences are that the options/modifiers `*`, `h`, `L`, `l`, `n`, and `p`\nare not supported and that there is an extra option, `q`.\n\nThe `q` option 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\n\n string.format('%q', 'a string with "quotes" and \n new line')\n\nmay produce the string:\n\n "a string with \"quotes\" and \\n new line"\n\nOptions `A` and `a` (when available), `E`, `e`, `f`, `G`, and `g` all expect\na number as argument. Options `c`, `d`, `i`, `o`, `u`, `X`, and `x` expect an\ninteger. Option `q` expects a string. Option `s` expects a string; if its\nargument is not a string, it is converted to one following the same rules of\n`tostring`. If the option has any modifier (flags, width, length), the string\nargument should not contain zeros. frexp math.frexp(x)\nReturns `m` and `e` such that 'x = m2^e', `e` is an integer and the\nabsolute value of `m` is in the range *[0.5, 1)* (or zero when `x` is zero).\n\nDeprecated in Lua 5.3. functions _SCINTILLA.functions (table)\nMap of Scintilla function names to tables containing their IDs, return types,\nwParam types, and lParam types. Types are as follows:\n\n + `0`: Void.\n + `1`: Integer.\n + `2`: Length of the given lParam string.\n + `3`: Integer position.\n + `4`: Color, in "0xBBGGRR" format.\n + `5`: Boolean `true` or `false`.\n + `6`: Bitmask of Scintilla key modifiers and a key value.\n + `7`: String parameter.\n + `8`: String return value. @@ -692,7 +695,7 @@ indic_under buffer.indic_under (table)\nTable of flags that indicate whether or indicator_all_on_for buffer.indicator_all_on_for(buffer, pos)\nReturns a bit-mask that represents which indicators are on at position *pos*.\nBit 0 is set if indicator 0 is on, bit 1 for indicator 1, etc.\n@param buffer A buffer.\n@param pos The position in *buffer* to get indicators at.\n@return number indicator_clear_range buffer.indicator_clear_range(buffer, pos, length)\nClears indicator number `buffer.indicator_current` over the range of text\nfrom position *pos* to *pos* + *length*.\n@param buffer A buffer.\n@param pos The start position of the range of text in *buffer* to clear\n indicators over.\n@param length The number of characters in the range of text to clear\n indicators over. indicator_current buffer.indicator_current (number)\nThe indicator number in the range of `0` to `31` used by\n`buffer.indicator_fill_range()` and\n`buffer.indicator_clear_range()`. -indicator_end buffer.indicator_end(buffer, indicator, pos)\nReturns the next boundary position, starting from position *pos*, of\nindicator number *indicator*, in the range of `0` to `31`.\nReturns `buffer.length` if *indicator* was not found.\n@param buffer A buffer.\n@param indicator An indicator number in the range of `0` to `31`.\n@param pos The position in *buffer* of the indicator. +indicator_end buffer.indicator_end(buffer, indicator, pos)\nReturns the next boundary position, starting from position *pos*, of\nindicator number *indicator*, in the range of `0` to `31`.\nReturns `0` if *indicator* was not found.\n@param buffer A buffer.\n@param indicator An indicator number in the range of `0` to `31`.\n@param pos The position in *buffer* of the indicator. indicator_fill_range buffer.indicator_fill_range(buffer, pos, length)\nFills the range of text from position *pos* to *pos* + *length* with\nindicator number `buffer.indicator_current`.\n@param buffer A buffer.\n@param pos The start position of the range of text in *buffer* to set\n indicators over.\n@param length The number of characters in the range of text to set indicators\n over. indicator_start buffer.indicator_start(buffer, indicator, pos)\nReturns the previous boundary position, starting from position *pos*, of\nindicator number *indicator*, in the range of `0` to `31`.\nReturns `0` if *indicator* was not found.\n@param buffer A buffer.\n@param indicator An indicator number in the range of `0` to `31`.\n@param pos The position in *buffer* of the indicator. input io.input([file])\nWhen called with a file name, it opens the named file (in text mode),\nand sets its handle as the default input file. When called with a file\nhandle, it simply sets this file handle as the default input file. When\ncalled without parameters, it returns the current default input file.\n\nIn case of errors this function raises the error, instead of returning an\nerror code. @@ -741,6 +744,7 @@ line_from_position lexer.line_from_position(pos)\nReturns the line number of the line_indent_position buffer.line_indent_position (table, Read-only)\nTable of positions at the ends of indentation for line numbers starting\nfrom zero. line_indentation buffer.line_indentation (table)\nTable of column indentation amounts, for line numbers starting from zero. line_length buffer.line_length(buffer, line)\nReturns the number of bytes on line number *line*, including end of line\ncharacters.\nTo get line length excluding end of line characters, use\n`buffer.line_end_position[line] - buffer.position_from_line(line)`.\n@param buffer A buffer.\n@param line The line number in *buffer* to get the length of.\n@return number +line_reverse buffer.line_reverse(buffer)\nReverses the order of the selected lines.\n@param buffer A buffer. line_scroll buffer.line_scroll(buffer, columns, lines)\nScrolls the buffer right *columns* columns and down *lines* lines.\nNegative values are allowed.\n@param buffer A buffer.\n@param columns The number of columns to scroll horizontally.\n@param lines The number of lines to scroll vertically. line_scroll_down buffer.line_scroll_down(buffer)\nScrolls the buffer down one line, keeping the caret visible.\n@param buffer A buffer. line_scroll_up buffer.line_scroll_up(buffer)\nScrolls the buffer up one line, keeping the caret visible.\n@param buffer A buffer. @@ -1086,7 +1090,7 @@ style_at lexer.style_at (table, Read-only)\nTable of style names at positions in style_back buffer.style_back (table)\nTable of background colors, in "0xBBGGRR" format, of text for style numbers\nfrom `0` to `255`. style_bold buffer.style_bold (table)\nTable of flags that indicate whether or not text is bold for style numbers\nfrom `0` to `255`.\nThe default values are `false`. style_case buffer.style_case (table)\nTable of letter case modes of text for style numbers from `0` to `255`.\n\n* `buffer.CASE_MIXED`\n Display text in normally.\n* `buffer.CASE_UPPER`\n Display text in upper case.\n* `buffer.CASE_LOWER`\n Display text in lower case.\n* `buffer.CASE_CAMEL`\n Display text in camel case.\n\nThe default values are `buffer.CASE_MIXED`. -style_changeable buffer.style_changeable (table)\nTable of flags that indicate whether or not text is changeable for style\nnumbers from `0` to `255`.\nThe default values are `true`.\nCurrently, read-only styles do not allow the caret into the range of text,\nbut ranges that contain read-only text are deletable. +style_changeable buffer.style_changeable (table)\nTable of flags that indicate whether or not text is changeable for style\nnumbers from `0` to `255`.\nThe default values are `true`.\nRead-only styles do not allow the caret into the range of text. style_clear_all buffer.style_clear_all(buffer)\nReverts all styles to having the same properties as `buffer.STYLE_DEFAULT`.\n@param buffer A buffer. style_eol_filled buffer.style_eol_filled (table)\nTable of flags that indicate whether or not the background colors of styles\nwhose characters occur last on lines extend all the way to the view's right\nmargin for style numbers from `0` to `255`.\nThe default values are `false`. style_font buffer.style_font (table)\nTable of string font names of text for style numbers from `0` to `255`. diff --git a/modules/lua/tags b/modules/lua/tags index 1995a7f1..3d50f160 100644 --- a/modules/lua/tags +++ b/modules/lua/tags @@ -453,6 +453,7 @@ cancel _ 0;" f class:buffer caret_fore _ 0;" F class:buffer caret_line_back _ 0;" F class:buffer caret_line_back_alpha _ 0;" F class:buffer +caret_line_frame _ 0;" F class:buffer caret_line_visible _ 0;" F class:buffer caret_line_visible_always _ 0;" F class:buffer caret_period _ 0;" F class:buffer @@ -490,6 +491,7 @@ cntrl _ 0;" F class:lexer codepoint _ 0;" f class:utf8 codes _ 0;" f class:utf8 collectgarbage _ 0;" f +colorselect _ 0;" f class:ui.dialogs colourise _ 0;" f class:buffer column _ 0;" F class:buffer command_entry _ 0;" m class:ui @@ -628,6 +630,7 @@ fold_level _ 0;" F class:lexer fold_line _ 0;" f class:buffer fold_line_comments _ 0;" f class:lexer fold_parent _ 0;" F class:buffer +fontselect _ 0;" f class:ui.dialogs format _ 0;" f class:string frexp _ 0;" f class:math functions _ 0;" t class:_SCINTILLA @@ -749,6 +752,7 @@ line_from_position _ 0;" f class:lexer line_indent_position _ 0;" F class:buffer line_indentation _ 0;" F class:buffer line_length _ 0;" f class:buffer +line_reverse _ 0;" f class:buffer line_scroll _ 0;" f class:buffer line_scroll_down _ 0;" f class:buffer line_scroll_up _ 0;" f class:buffer |