diff options
Diffstat (limited to 'modules/lua/api')
-rw-r--r-- | modules/lua/api | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/modules/lua/api b/modules/lua/api index 9482fa50..2585615d 100644 --- a/modules/lua/api +++ b/modules/lua/api @@ -334,7 +334,7 @@ _cancel_current textadept.snippets._cancel_current()\nCancels the active snippet _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 _paths textadept.snippets._paths (table)\nList of directory paths to look for snippet files in.\nFilenames are of the form *lexer.trigger.ext* or *trigger.ext* (*.ext* is an\noptional, arbitrary file extension). If the global `snippets` table does not\ncontain a snippet for a given trigger, this table is consulted for a matching\nfilename, and the contents of that file is inserted as a snippet.\nNote: If a directory has multiple snippets with the same trigger, the snippet\nchosen for insertion is not defined and may not be constant. _previous textadept.snippets._previous()\nJumps back to the previous snippet placeholder, reverting any changes from\nthe current one.\nReturns `false` if no snippet is active.\n@return `false` if no snippet is active; `nil` otherwise. -_print ui._print(buffer_type, ...)\nPrints the given string messages to the buffer of string type *buffer_type*.\nOpens a new buffer for printing messages to if necessary. If the message\nbuffer is already open in a view, the message is printed to that view.\nOtherwise the view is split (unless `ui.tabs` is `true`) and the message\nbuffer is displayed before being printed to.\n@param buffer_type String type of message buffer.\n@param ... Message strings.\n@usage ui._print(_L['[Message Buffer]'], message) +_print ui._print(buffer_type, ...)\nPrints the given string messages to the buffer of string type *buffer_type*.\nOpens a new buffer for printing messages to if necessary. If the message\nbuffer is already open in a view, the message is printed to that view.\nOtherwise the view is split (unless `ui.tabs` is `true`) and the message\nbuffer is displayed before being printed to.\nAt this time, `ui.print()` cannot be used until Textadept is fully\ninitialized. (That is, not until `events.INITIALIZED` is emitted.)\n@param buffer_type String type of message buffer.\n@param ... Message strings.\n@usage ui._print(_L['[Message Buffer]'], message) _select textadept.snippets._select()\nPrompts the user to select a snippet to insert from a list of global and\nlanguage-specific snippets. abs math.abs(x)\nReturns the absolute value of `x`. (integer/float) abspath lfs.abspath(filename, prefix)\nReturns the absolute path to string *filename*.\n*prefix* or `lfs.currentdir()` is prepended to a relative filename. The\nreturned path is not guaranteed to exist.\n@param filename The relative or absolute path to a file.\n@param prefix Optional prefix path prepended to a relative filename.\n@return string absolute path @@ -685,7 +685,7 @@ indic_fore buffer.indic_fore (table)\nTable of foreground colors, in "0xBBGGRR" indic_hover_fore buffer.indic_hover_fore (table)\nTable of hover foreground colors, in "0xBBGGRR" format, for indicator\nnumbers from `0` to `31`.\nThe default values are the respective indicator foreground colors. indic_hover_style buffer.indic_hover_style (table)\nTable of hover styles for indicators numbers from `0` to `31`. An\nindicator's hover style drawn when either the cursor hovers over that\nindicator or the caret is within that indicator.\nThe default values are the respective indicator styles. indic_outline_alpha buffer.indic_outline_alpha (table)\nTable of outline color alpha values, ranging from `0` (transparent) to\n`255` (opaque), for indicator numbers from `0` to `31` whose styles are\neither `INDIC_ROUNDBOX`, `INDIC_STRAIGHTBOX`, or `INDIC_DOTBOX`.\nThe default values are `buffer.ALPHA_NOALPHA`, for no alpha. -indic_style buffer.indic_style (table)\nTable of styles for indicator numbers from `0` to `31`.\n\n* `buffer.INDIC_PLAIN`\n An underline.\n* `buffer.INDIC_SQUIGGLE`\n A squiggly underline 3 pixels in height.\n* `buffer.INDIC_TT`\n An underline of small 'T' shapes.\n* `buffer.INDIC_DIAGONAL`\n An underline of diagonal hatches.\n* `buffer.INDIC_STRIKE`\n Strike out.\n* `buffer.INDIC_HIDDEN`\n Invisible.\n* `buffer.INDIC_BOX`\n A bounding box.\n* `buffer.INDIC_ROUNDBOX`\n A translucent box with rounded corners around the text. Use\n `buffer.indic_alpha` and `buffer.indic_outline_alpha` to set the\n fill and outline transparency, respectively. Their default values are\n `30` and `50`.\n* `buffer.INDIC_STRAIGHTBOX`\n Similar to `INDIC_ROUNDBOX` but with sharp corners.\n* `buffer.INDIC_DASH`\n A dashed underline.\n* `buffer.INDIC_DOTS`\n A dotted underline.\n* `buffer.INDIC_SQUIGGLELOW`\n A squiggly underline 2 pixels in height.\n* `buffer.INDIC_DOTBOX`\n Similar to `INDIC_STRAIGHTBOX` but with a dotted outline.\n Translucency alternates between `buffer.indic_alpha` and\n `buffer.indic_outline_alpha` starting with the top-left pixel.\n* `buffer.INDIC_SQUIGGLEPIXMAP`\n Identical to `INDIC_SQUIGGLE` but draws faster by using a pixmap instead\n of multiple line segments.\n* `buffer.INDIC_COMPOSITIONTHICK`\n A 2-pixel thick underline at the bottom of the line inset by 1 pixel on\n on either side. Similar in appearance to the target in Asian language\n input composition.\n* `buffer.INDIC_COMPOSITIONTHIN`\n A 1-pixel thick underline just before the bottom of the line inset by 1\n pixel on either side. Similar in appearance to the non-target ranges in\n Asian language input composition.\n* `buffer.INDIC_FULLBOX`\n Similar to `INDIC_STRAIGHTBOX` but extends to the top of its line,\n potentially touching any similar indicators on the line above.\n* `buffer.INDIC_TEXTFORE`\n Changes the color of text to an indicator's foreground color.\n* `buffer.INDIC_POINT`\n A triangle below the start of the indicator range.\n* `buffer.INDIC_POINTCHARACTER`\n A triangle below the centre of the first character of the indicator\n range.\n* `buffer.INDIC_GRADIENT`\n A box with a vertical gradient from solid on top to transparent on \n bottom.\n* `buffer.INDIC_GRADIENTCENTRE`\n A box with a centered gradient from solid in the middle to transparent on\n the top and bottom.\n\nUse `_SCINTILLA.next_indic_number()` for custom indicators.\nChanging an indicator's style resets that indicator's hover style. +indic_style buffer.indic_style (table)\nTable of styles for indicator numbers from `0` to `31`.\n\n* `buffer.INDIC_PLAIN`\n An underline.\n* `buffer.INDIC_SQUIGGLE`\n A squiggly underline 3 pixels in height.\n* `buffer.INDIC_TT`\n An underline of small 'T' shapes.\n* `buffer.INDIC_DIAGONAL`\n An underline of diagonal hatches.\n* `buffer.INDIC_STRIKE`\n Strike out.\n* `buffer.INDIC_HIDDEN`\n Invisible.\n* `buffer.INDIC_BOX`\n A bounding box.\n* `buffer.INDIC_ROUNDBOX`\n A translucent box with rounded corners around the text. Use\n `buffer.indic_alpha` and `buffer.indic_outline_alpha` to set the\n fill and outline transparency, respectively. Their default values are\n `30` and `50`.\n* `buffer.INDIC_STRAIGHTBOX`\n Similar to `INDIC_ROUNDBOX` but with sharp corners.\n* `buffer.INDIC_DASH`\n A dashed underline.\n* `buffer.INDIC_DOTS`\n A dotted underline.\n* `buffer.INDIC_SQUIGGLELOW`\n A squiggly underline 2 pixels in height.\n* `buffer.INDIC_DOTBOX`\n Similar to `INDIC_STRAIGHTBOX` but with a dotted outline.\n Translucency alternates between `buffer.indic_alpha` and\n `buffer.indic_outline_alpha` starting with the top-left pixel.\n* `buffer.INDIC_SQUIGGLEPIXMAP`\n Identical to `INDIC_SQUIGGLE` but draws faster by using a pixmap instead\n of multiple line segments.\n* `buffer.INDIC_COMPOSITIONTHICK`\n A 2-pixel thick underline at the bottom of the line inset by 1 pixel on\n on either side. Similar in appearance to the target in Asian language\n input composition.\n* `buffer.INDIC_COMPOSITIONTHIN`\n A 1-pixel thick underline just before the bottom of the line inset by 1\n pixel on either side. Similar in appearance to the non-target ranges in\n Asian language input composition.\n* `buffer.INDIC_FULLBOX`\n Similar to `INDIC_STRAIGHTBOX` but extends to the top of its line,\n potentially touching any similar indicators on the line above.\n* `buffer.INDIC_TEXTFORE`\n Changes the color of text to an indicator's foreground color.\n* `buffer.INDIC_POINT`\n A triangle below the start of the indicator range.\n* `buffer.INDIC_POINTCHARACTER`\n A triangle below the centre of the first character of the indicator\n range.\n* `buffer.INDIC_GRADIENT`\n A box with a vertical gradient from solid on top to transparent on\n bottom.\n* `buffer.INDIC_GRADIENTCENTRE`\n A box with a centered gradient from solid in the middle to transparent on\n the top and bottom.\n\nUse `_SCINTILLA.next_indic_number()` for custom indicators.\nChanging an indicator's style resets that indicator's hover style. indic_under buffer.indic_under (table)\nTable of flags that indicate whether or not to draw indicators behind text\ninstead of over the top of it for indicator numbers from `0` to `31`.\nThe default values are `false`. 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. @@ -755,6 +755,7 @@ lines_on_screen buffer.lines_on_screen (number, Read-only)\nThe number of comple lines_split buffer.lines_split(buffer, pixel_width, width)\nSplits the lines in the target range into lines *width* pixels wide.\nIf *width* is `0`, splits the lines in the target range into lines as wide as\nthe view.\n@param buffer A buffer.\n@param width The pixel width to split lines at. When `0`, uses the width of\n the view. load _G.load(chunk [, chunkname [, mode [, env]]])\nLoads a chunk.\n\nIf `chunk` is a string, the chunk is this string. If `chunk` is a function, `load`\ncalls it repeatedly to get the chunk pieces. Each call to `chunk` must return a\nstring that concatenates with previous results. A return of an empty string,\nnil, or no value signals the end of the chunk.\n\nIf there are no syntactic errors, returns the compiled chunk as a function;\notherwise, returns nil plus the error message.\n\nIf the resulting function has upvalues, the first upvalue is set to the value\nof `env`, if that parameter is given, or to the value of the global\nenvironment. Other upvalues are initialized with nil. (When you load a main\nchunk, the resulting function will always have exactly one upvalue, the\n`_ENV` variable (see §2.2). However, when you load a binary chunk created\nfrom a function (see `string.dump`), the resulting function can have an\narbitrary number of upvalues.) All upvalues are fresh, that is, they are not\nshared with any other function.\n\n`chunkname` is used as the name of the chunk for error messages and debug\ninformation (see §4.9). When absent, it defaults to `chunk`, if `chunk` is a\nstring, or to "`=(load)`" otherwise.\n\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\nLua does not check the consistency of binary chunks. Maliciously crafted\nbinary chunks can crash the interpreter. load lexer.load(name, alt_name, cache)\nInitializes or loads and returns the lexer of string name *name*.\nScintilla calls this function in order to load a lexer. Parent lexers also\ncall this function in order to load child lexers and vice-versa. The user\ncalls this function in order to load a lexer when using this module as a Lua\nlibrary.\n@param name The name of the lexing language.\n@param alt_name The alternate name of the lexing language. This is useful for\n embedding the same child lexer with multiple sets of start and end tokens.\n@param cache Flag indicating whether or not to load lexers from the cache.\n This should only be `true` when initially loading a lexer (e.g. not from\n within another lexer for embedding purposes).\n The default value is `false`.\n@return lexer object +load textadept.macros.load(filename)\nLoads a macro from file *filename* or the user-selected file.\n@param filename Optional macro file to load. If `nil`, the user is prompted\n for one. load textadept.session.load(filename)\nLoads session file *filename* or the user-selected session, returning `true`\nif a session file was opened and read.\nTextadept restores split views, opened buffers, cursor information, recent\nfiles, and bookmarks.\n@param filename Optional absolute path to the session file to load. If `nil`,\n the user is prompted for one.\n@usage textadept.session.load(filename)\n@return `true` if the session file was opened and read; `false` otherwise. loaded package.loaded (table)\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.\nThis variable is only a reference to the real table; assignments to this\nvariable do not change the table used by `require`. loaders package.loaders (table)\nSee `package.searchers`.\n\nDeprecated in Lua 5.2. @@ -775,6 +776,7 @@ lshift bit32.lshift(x, disp)\nReturns the number `x` shifted `disp` bits to the lua _G.keys.lua (table)\nContainer for Lua-specific key bindings. lua _G.snippets.lua (table)\nContainer for Lua-specific snippets. lua _M.lua (module)\nThe lua module.\nIt provides utilities for editing Lua code. +macros textadept.macros (module)\nA module for recording, playing, saving, and loading keyboard macros.\nMenu commands are also recorded.\nAt this time, typing into multiple cursors during macro playback is not\nsupported. main_selection buffer.main_selection (number)\nThe number of the main, or most recent, selection.\nOnly an existing selection can be made main. margin_back_n buffer.margin_back_n (table)\nTable of background colors, in "0xBBGGRR" format, of margin numbers from\n`0` to `buffer.margins - 1` (`4` by default).\nOnly affects margins of type `buffer.MARGIN_COLOUR`. margin_cursor_n buffer.margin_cursor_n (table)\nTable of cursor types shown over margin numbers from `0` to\n`buffer.margins - 1` (`4` by default).\n\n* `buffer.CURSORARROW`\n Normal arrow cursor.\n* `buffer.CURSORREVERSEARROW`\n Reversed arrow cursor.\n\nThe default values are `buffer.CURSORREVERSEARROW`. @@ -846,7 +848,7 @@ nested_pair lexer.nested_pair(start_chars, end_chars)\nReturns a pattern that ma new buffer.new()\nCreates and returns a new buffer.\nEmits a `BUFFER_NEW` event.\n@return the new buffer.\n@see events.BUFFER_NEW new lexer.new(name, opts)\nCreates a returns a new lexer with the given name.\n@param name The lexer's name.\n@param opts Table of lexer options. Options currently supported:\n * `lex_by_line`: Whether or not the lexer only processes whole lines of\n text (instead of arbitrary chunks of text) at a time.\n Line lexers cannot look ahead to subsequent lines.\n The default value is `false`.\n * `fold_by_indentation`: Whether or not the lexer does not define any fold\n points and that fold points should be calculated based on changes in line\n indentation.\n The default value is `false`.\n * `case_insensitive_fold_points`: Whether or not fold points added via\n `lexer.add_fold_point()` ignore case.\n The default value is `false`.\n * `inherit`: Lexer to inherit from.\n The default value is `nil`.\n@usage lexer.new('rhtml', {inherit = lexer.load('html')}) new_line buffer.new_line(buffer)\nTypes a new line at the caret position according to `buffer.eol_mode`.\n@param buffer A buffer. -newline lexer.newline (pattern)\nA pattern that matches any set of end of line characters. +newline lexer.newline (pattern)\nA pattern that matches a sequence of end of line characters. 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.\n\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`.)\n\nThe behavior of `next` is undefined if, during the traversal, you assign any\nvalue to a non-existent field in the table. You may however modify existing\nfields. In particular, you may clear existing fields. next_image_type _SCINTILLA.next_image_type()\nReturns a unique image type identier number for use with\n`buffer.register_image()` and `buffer.register_rgba_image()`.\nUse this function for custom image types in order to prevent clashes with\nidentifiers of other custom image types.\n@usage local image_type = _SCINTILLA.next_image_type()\n@see buffer.register_image\n@see buffer.register_rgba_image next_indic_number _SCINTILLA.next_indic_number()\nReturns a unique indicator number for use with custom indicators.\nUse this function for custom indicators in order to prevent clashes with\nidentifiers of other custom indicators.\n@usage local indic_num = _SCINTILLA.next_indic_number()\n@see buffer.indic_style @@ -881,13 +883,12 @@ para_down_extend buffer.para_down_extend(buffer)\nMoves the caret down one parag para_up buffer.para_up(buffer)\nMoves the caret up one paragraph.\nParagraphs are surrounded by one or more blank lines.\n@param buffer A buffer. para_up_extend buffer.para_up_extend(buffer)\nMoves the caret up one paragraph, extending the selected text to the new\nposition.\nParagraphs are surrounded by one or more blank lines.\n@param buffer A buffer. paste buffer.paste(buffer)\nPastes the clipboard's contents into the buffer, replacing any selected text\naccording to `buffer.multi_paste`.\n@param buffer A buffer. -paste textadept.editing.paste()\nPastes the text from the clipboard, taking into account the buffer's\nindentation settings and the indentation of the current and preceding lines. -paste_reindents textadept.editing.paste_reindents (bool)\nReindent pasted text according to the buffer's indentation settings.\nThe default value is `true`. path lexer.path (string)\nThe path used to search for a lexer to load.\nIdentical in format to Lua's `package.path` string.\nThe default value is `package.path`. path package.path (string)\nThe path used by `require` to search for a Lua loader.\nAt start-up, Lua initializes this variable with the value of the\nenvironment variable `LUA_PATH_5_3` or the environment variable `LUA_PATH`\nor with a default path defined in `luaconf.h`, if those environment\nvariables are not defined. Any "`;;`" in the value of the environment\nvariable is replaced by the default path. patterns textadept.file_types.patterns (table)\nMap of first-line patterns to their associated lexer names.\nEach pattern is matched against the first line in the file. pcall _G.pcall(f [, arg1, ···])\nCalls function `f` with the given arguments in *protected mode*. This\nmeans that any error inside `f` is not propagated; instead, `pcall` catches\nthe error 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. pi math.pi (number)\nThe value of 'π'. +play textadept.macros.play()\nPlays a recorded or loaded macro.\n@see load popen io.popen(prog [, mode])\nStarts program `prog` in a separated process and returns a file handle\nthat you can use to read data from this program (if `mode` is `"r"`,\nthe default) or to write data to this program (if `mode` is `"w"`).\n\nThis function is system dependent and is not available on all platforms. position_after buffer.position_after(buffer, pos)\nReturns the position of the character after position *pos* (taking multi-byte\ncharacters into account), or `buffer.length` if there is no character after\n*pos*.\n@param buffer A buffer.\n@param pos The position in *buffer* to get the position after from. position_before buffer.position_before(buffer, pos)\nReturns the position of the character before position *pos* (taking\nmulti-byte characters into account), or `0` if there is no character before\n*pos*.\n@param buffer A buffer.\n@param pos The position in *buffer* to get the position before from.\n@return number @@ -975,6 +976,7 @@ run textadept.run.run(filename)\nRuns file *filename* or the current file using run_commands textadept.run.run_commands (table)\nMap of filenames, file extensions, and lexer names to their associated "run"\nshell command line strings or functions that return strings.\nCommand line strings may have the following macros:\n\n + `%f`: The file's name, including its extension.\n + `%e`: The file's name, excluding its extension.\n + `%d`: The file's directory path.\n + `%p`: The file's full path.\n\nFunctions may also return a working directory to operate in. By default, it\nis the current file's parent directory. run_in_background textadept.run.run_in_background (bool)\nRun shell commands silently in the background.\nThis only applies when the message buffer is open, though it does not have\nto be visible.\nThe default value is `false`. running coroutine.running()\nReturns the running coroutine plus a boolean, true when the running coroutine\nis the main one. +save textadept.macros.save(filename)\nSaves a recorded macro to file *filename* or the user-selected file.\n@param filename Optional filename to save the recorded macro to. If `nil`,\n the user is prompted for one. save textadept.session.save(filename)\nSaves the session to file *filename* or the user-selected file.\nSaves split views, opened buffers, cursor information, recent files, and\nbookmarks.\n@param filename Optional absolute path to the session file to save. If `nil`,\n the user is prompted for one.\n@usage textadept.session.save(filename) save_all_files io.save_all_files()\nSaves all unsaved buffers to their respective files.\n@see io.save_file save_file io.save_file()\nSaves the current buffer to its file.\nEmits `FILE_BEFORE_SAVE` and `FILE_AFTER_SAVE` events. @@ -1064,11 +1066,12 @@ snippets _G.snippets (table)\nMap of snippet triggers with their snippet text or snippets textadept.snippets (module)\nSnippets for Textadept. 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\nthe second in the final order (so that, after the sort, `i < j` implies\n`not comp(list[j],list[i])` will be true after the sort). If `comp` is not\ngiven, then the standard Lua operator `<` is used instead.\n\nNote that the `comp` function must not define a string partial order over the\nelements in the list; that is, it must be asymmetric and transitive.\nOtherwise, no valid sort may be possible.\n\nThe sort algorithm is not stable; that is, elements not comparable by the\ngiven order (e.g., equal elements) may have their relative positions changed\nby the sort. space lexer.space (pattern)\nA pattern that matches any whitespace character ('\t', '\v', '\f', '\n',\n'\r', space). -spawn os.spawn(argv, cwd, env, stdout_cb, stderr_cb, exit_cb)\nSpawns an interactive child process *argv* in a separate thread, returning\na handle to that process.\nOn Windows, *argv* is passed to `cmd.exe`: `%COMSPEC% /c [argv]`.\nAt the moment, only the Windows terminal version spawns processes in the same\nthread.\n@param argv A command line string that contains the program's name followed\n by arguments to pass to it. `PATH` is searched for program names.\n@param cwd Optional current working directory (cwd) for the child\n process. The default value is `nil`, which inherits the parent's cwd.\n@param env Optional list of environment variables for the child process.\n Each element in the list is a 'KEY=VALUE' string. The default value is\n `nil`, which inherits the parent's environment.\n This parameter should be omitted completely instead of specifying `nil`.\n@param stdout_cb Optional Lua function that accepts a string parameter for a\n block of standard output read from the child. Stdout is read asynchronously\n in 1KB or 0.5KB blocks (depending on the platform), or however much data is\n available at the time.\n At the moment, only the Win32 terminal version sends all output, whether it\n be stdout or stderr, to this callback after the process finishes.\n@param stderr_cb Optional Lua function that accepts a string parameter for a\n block of standard error read from the child. Stderr is read asynchronously\n in 1KB or 0.5kB blocks (depending on the platform), or however much data is\n available at the time.\n@param exit_cb Optional Lua function that is called when the child process\n finishes. The child's exit status is passed.\n@usage os.spawn('lua buffer.filename', nil, print)\n@usage proc = os.spawn('lua -e "print(io.read())"', nil, print)\n proc:write('foo\n')\n@return proc or nil plus an error message on failure +spawn os.spawn(argv, cwd, env, stdout_cb, stderr_cb, exit_cb)\nSpawns an interactive child process *argv* in a separate thread, returning\na handle to that process.\nOn Windows, *argv* is passed to `cmd.exe`: `%COMSPEC% /c [argv]`.\nAt the moment, only the Windows terminal version spawns processes in the same\nthread.\n@param argv A command line string that contains the program's name followed\n by arguments to pass to it. `PATH` is searched for program names.\n@param cwd Optional current working directory (cwd) for the child\n process. When omitted, the parent's cwd is used.\n@param env Optional list of environment variables for the child process.\n Each element in the list is a 'KEY=VALUE' string. When omitted, the\n parent's environment is used.\n@param stdout_cb Optional Lua function that accepts a string parameter for a\n block of standard output read from the child. Stdout is read asynchronously\n in 1KB or 0.5KB blocks (depending on the platform), or however much data is\n available at the time.\n At the moment, only the Win32 terminal version sends all output, whether it\n be stdout or stderr, to this callback after the process finishes.\n@param stderr_cb Optional Lua function that accepts a string parameter for a\n block of standard error read from the child. Stderr is read asynchronously\n in 1KB or 0.5kB blocks (depending on the platform), or however much data is\n available at the time.\n@param exit_cb Optional Lua function that is called when the child process\n finishes. The child's exit status is passed.\n@usage os.spawn('lua buffer.filename', print)\n@usage proc = os.spawn('lua -e "print(io.read())"', print)\n proc:write('foo\n')\n@return proc or nil plus an error message on failure split view.split(view, vertical)\nSplits the view into top and bottom views (unless *vertical* is `true`),\nfocuses the new view, and returns both the old and new views.\nIf *vertical* is `false`, splits the view vertically into left and\nright views.\nEmits a `VIEW_NEW` event.\n@param view The view to split.\n@param vertical Optional flag indicating whether or not to split the view\n vertically. The default value is `false`, for horizontal.\n@return old view and new view.\n@see events.VIEW_NEW sqrt math.sqrt(x)\nReturns the square root of `x`. (You can also use the expression `x^0.5`\nto compute this value.) standard_dropdown ui.dialogs.standard_dropdown(options)\nPrompts the user with a drop-down item selection dialog defined by dialog\noptions table *options* and with localized "Ok" and "Cancel" buttons,\nreturning the selected button's index along with the selected item's index.\nIf *options*.`string_output` is `true`, returns the selected button's label\nalong with the selected item's text.\nIf the dialog closed due to *options*.`exit_onchange`, returns `4` along with\neither the selected item's index or its text. If the dialog timed out,\nreturns `0` or `"timeout"`. If the user canceled the dialog, returns `-1` or\n`"delete"`.\n@param options Table of key-value option pairs for the drop-down dialog.\n\n * `title`: The dialog's title text.\n * `text`: The dialog's main message text.\n * `items`: The list of string items to show in the drop-down.\n * `no_cancel`: Do not display the "Cancel" button. The default value is\n `false`.\n * `exit_onchange`: Close the dialog after selecting a new item. The default\n value is `false`.\n * `select`: The index of the initially selected list item. The default\n value is `1`.\n * `string_output`: Return the selected button's label (instead of its\n index) and the selected item's text (instead of its index). If no item\n was selected, returns the dialog's exit status (instead of its exit\n code). The default value is `false`.\n * `width`: The dialog's pixel width.\n * `height`: The dialog's pixel height.\n * `float`: Show the dialog on top of all desktop windows. The default value\n is `false`.\n * `timeout`: The integer number of seconds the dialog waits for the user to\n select a button before timing out. Dialogs do not time out by default.\n@return selected button or exit code, selected item standard_inputbox ui.dialogs.standard_inputbox(options)\nPrompts the user with an inputbox dialog defined by dialog options table\n*options* and with localized "Ok" and "Cancel" buttons, returning the\nselected button's index along with the user's input text (the latter as a\nstring or table, depending on the type of *options*.`informative_text`).\nIf *options*.`string_output` is `true`, returns the selected button's label\nalong with the user's input text.\nIf the dialog timed out, returns `0` or `"timeout"`. If the user canceled the\ndialog, returns `-1` or `"delete"`.\n@param options Table of key-value option pairs for the inputbox.\n\n * `title`: The dialog's title text.\n * `informative_text`: The dialog's main message text. If the value is a\n table, the first table value is the main message text and any subsequent\n values are used as the labels for multiple entry boxes. Providing a\n single label has no effect.\n * `text`: The dialog's initial input text. If the value is a table, the\n table values are used to populate the multiple entry boxes defined by\n `informative_text`.\n * `no_cancel`: Do not display the "Cancel" button. The default value is\n `false`.\n * `string_output`: Return the selected button's label (instead of its\n index) or the dialog's exit status instead of the button's index (instead\n of its exit code). The default value is `false`.\n * `width`: The dialog's pixel width.\n * `height`: The dialog's pixel height.\n * `float`: Show the dialog on top of all desktop windows. The default value\n is `false`.\n * `timeout`: The integer number of seconds the dialog waits for the user to\n select a button before timing out. Dialogs do not time out by default.\n@return selected button or exit code, input text +start_recording textadept.macros.start_recording()\nBegins recording a macro. start_styling buffer.start_styling(buffer, position, style_mask)\nBegins styling at position *position* with styling bit-mask *style_mask*.\n*style_mask* specifies which style bits can be set with\n`buffer.set_styling()`.\n@param buffer A buffer.\n@param position The position in *buffer* to start styling at.\n@param style_mask The bit mask of style bits that can be set when styling.\n@usage buffer:start_styling(0, 0xFF)\n@see set_styling starts_line lexer.starts_line(patt)\nCreates and returns a pattern that matches pattern *patt* only at the\nbeginning of a line.\n@param patt The LPeg pattern to match on the beginning of a line.\n@usage local preproc = token(lexer.PREPROCESSOR, lexer.starts_line('#') *\n lexer.nonnewline^0)\n@return pattern status coroutine.status(co)\nReturns the status of coroutine `co`, as a string: `"running"`, if\nthe coroutine is running (that is, it called `status`); `"suspended"`, if\nthe coroutine is suspended in a call to `yield`, or if it has not started\nrunning yet; `"normal"` if the coroutine is active but not running (that\nis, it has resumed another coroutine); and `"dead"` if the coroutine has\nfinished its body function, or if it has stopped with an error. @@ -1078,6 +1081,7 @@ stderr io.stderr (file)\nStandard error. stdin io.stdin (file)\nStandard in. stdout io.stdout (file)\nStandard out. stop textadept.run.stop()\nStops the currently running process, if any. +stop_recording textadept.macros.stop_recording()\nStops recording a macro. string _G.string (module)\nLua string module. strip_trailing_spaces textadept.editing.strip_trailing_spaces (bool)\nStrip trailing whitespace before saving files.\nThe default value is `false`. stuttered_page_down buffer.stuttered_page_down(buffer)\nMoves the caret to the bottom of the page or, if already there, down one\npage.\n@param buffer A buffer. @@ -1186,7 +1190,7 @@ view_eol buffer.view_eol (bool)\nDisplay end of line characters.\nThe default va view_ws buffer.view_ws (number)\nThe whitespace visibility mode.\n\n* `buffer.WS_INVISIBLE`\n Whitespace is invisible.\n* `buffer.WS_VISIBLEALWAYS`\n Display all space characters as dots and tab characters as arrows.\n* `buffer.WS_VISIBLEAFTERINDENT`\n Display only non-indentation spaces and tabs as dots and arrows.\n* `buffer.WS_VISIBLEONLYININDENT`\n Display only indentation spaces and tabs as dots and arrows.\n\nThe default value is `buffer.WS_INVISIBLE`. virtual_space_options buffer.virtual_space_options (number)\nThe virtual space mode.\n\n* `buffer.VS_NONE`\n Disable virtual space.\n* `buffer.VS_RECTANGULARSELECTION`\n Enable virtual space only for rectangular selections.\n* `buffer.VS_USERACCESSIBLE`\n Enable virtual space.\n* `buffer.VS_NOWRAPLINESTART`\n Prevent the caret from wrapping to the previous line via\n `buffer:char_left()` and `buffer:char_left_extend()`. This option is not\n restricted to virtual space and should be added to any of the above\n options.\n\nWhen virtual space is enabled, the caret may move into the space past end\nof line characters.\nThe default value is `buffer.VS_NONE`. visible_from_doc_line buffer.visible_from_doc_line(buffer, line)\nReturns the displayed line number of actual line number *line*, taking hidden\nlines into account, or `-1` if *line* is outside the range of lines in the\nbuffer.\nLines can occupy more than one display line if they wrap.\n@param buffer A buffer.\n@param line The line number in *buffer* to use.\n@return number -wait spawn_proc:wait()\nBlocks until process *spawn_proc* finishes. +wait spawn_proc:wait()\nBlocks until process *spawn_proc* finishes and returns its status code.\n@return integer status code whitespace_chars buffer.whitespace_chars (string)\nThe string set of characters recognized as whitespace characters.\nSet this only after setting `buffer.word_chars`.\nThe default value is a string that contains all non-newline characters less\nthan ASCII value 33. whitespace_size buffer.whitespace_size (number)\nThe pixel size of the dots that represent space characters when whitespace\nis visible.\nThe default value is `1`. whole_word ui.find.whole_word (bool)\nMatch search text only when it is surrounded by non-word characters in\nsearches.\nThe default value is `false`. |