aboutsummaryrefslogtreecommitdiff
path: root/modules/lua
diff options
context:
space:
mode:
Diffstat (limited to 'modules/lua')
-rw-r--r--modules/lua/api12
-rw-r--r--modules/lua/tadoc.lua2
2 files changed, 7 insertions, 7 deletions
diff --git a/modules/lua/api b/modules/lua/api
index b37a0838..6ee67ec3 100644
--- a/modules/lua/api
+++ b/modules/lua/api
@@ -364,7 +364,7 @@ ansi_c _G.keys.ansi_c (table)\nTable of C-specific key bindings.\n\n+ `Shift+Ent
ansi_c _G.snippets.ansi_c (table)\nTable of C-specific snippets.
ansi_c _M.ansi_c (module)\nThe ansi_c module.\nIt provides utilities for editing C code.
any lexer.any (pattern)\nA pattern that matches any single character.
-api_files textadept.editing.api_files (table)\nMap of lexer names to API documentation file tables.\nEach line in an API file consists of a symbol name (not a fully qualified\nsymbol name), a space character, and that symbol's documentation. "\n"\nrepresents a newline character.\n@see show_documentation
+api_files textadept.editing.api_files (table)\nMap of lexer names to API documentation file tables.\nEach line in an API file consists of a symbol name (not a fully qualified\nsymbol name), a space character, and that symbol's documentation. "\\n"\nrepresents a newline character.\n@see show_documentation
append_text buffer.append_text(buffer, text)\nAppends string *text* to the end of the buffer without modifying any existing\nselections or scrolling the text into view.\n@param buffer A buffer.\n@param text The text to append.
arg _G.arg (table)\nTable of command line parameters passed to Textadept.\n@see args
args _G.args (module)\nProcesses command line arguments for Textadept.
@@ -562,7 +562,7 @@ end_undo_action buffer.end_undo_action(buffer)\nEnds a sequence of actions to be
ensure_visible buffer.ensure_visible(buffer, line)\nEnsures line number *line* is visible by expanding any fold points hiding it.\n@param buffer A buffer.\n@param line The line number in *buffer* to ensure visible.
ensure_visible_enforce_policy buffer.ensure_visible_enforce_policy(buffer, line)\nEnsures line number *line* is visible by expanding any fold points hiding it\nbased on the vertical caret policy previously defined in\n`buffer.set_visible_policy()`.\n@param buffer A buffer.\n@param line The line number in *buffer* to ensure visible.
enter_mode ui.command_entry.enter_mode(mode, lexer, height)\nOpens the command entry in key mode *mode*, highlighting text with lexer name\n*lexer*, and displaying *height* number of lines at a time.\nKey bindings will be looked up in `keys[mode]` instead of `keys`. The `Esc`\nkey exits the current mode, closes the command entry, and restores normal key\nlookup.\nThis function is useful for binding keys to enter a command entry mode.\n@param mode The key mode to enter into, or `nil` to exit the current mode.\n@param lexer Optional string lexer name to use for command entry text. The\n default value is `'text'`.\n@param height Optional number of lines to display in the command entry. The\n default value is `1`.\n@usage keys['ce'] =\n function() ui.command_entry.enter_mode('command_entry') end\n@see _G.keys.MODE
-eol_mode buffer.eol_mode (number)\nThe current end of line mode. Changing the current mode does not convert\nany of the buffer's existing end of line characters.\nUse `buffer.convert_eols()` to do so.\n\n* `buffer.EOL_CRLF`\n Carriage return with line feed ("\r\n").\n* `buffer.EOL_CR`\n Carriage return ("\r").\n* `buffer.EOL_LF`\n Line feed ("\n").\n\nThe default value is `buffer.EOL_CRLF` on Windows platforms,\n`buffer.EOL_LF` otherwise.
+eol_mode buffer.eol_mode (number)\nThe current end of line mode. Changing the current mode does not convert\nany of the buffer's existing end of line characters.\nUse `buffer.convert_eols()` to do so.\n\n* `buffer.EOL_CRLF`\n Carriage return with line feed ("\r\\n").\n* `buffer.EOL_CR`\n Carriage return ("\r").\n* `buffer.EOL_LF`\n Line feed ("\\n").\n\nThe default value is `buffer.EOL_CRLF` on Windows platforms,\n`buffer.EOL_LF` otherwise.
error _G.error(message [, level])\nTerminates the last protected function called and returns `message`\nas the error object. Function `error` never returns.\n\nUsually, `error` adds some information about the error position at the\nbeginning of the message, if the message is a string. The `level` argument\nspecifies how to get the error position. With level 1 (the default), the\nerror position is where the `error` function was called. Level 2 points the\nerror to where the function that called `error` was called; and so on.\nPassing a level 0 avoids the addition of error position information to the\nmessage.
error_patterns textadept.run.error_patterns (table)\nMap of file extensions and lexer names to their associated lists of string\npatterns that match warning and error messages emitted by compile and run\ncommands for those file extensions and lexers.\nPatterns match single lines and contain captures for a filename, line number,\ncolumn number (optional), and warning or error message (optional).\nDouble-clicking a warning or error message takes the user to the source of\nthat warning/error.\nNote: `(.-)` captures in patterns are interpreted as filenames; `(%d+)`\ncaptures are interpreted as line numbers first, and then column numbers; and\nany other capture is treated as warning/error message text.
events _G.events (module)\nTextadept's core event structure and handlers.\n\nTextadept emits events when you do things like create a new buffer, press a\nkey, click on a menu, etc. You can even emit events yourself using Lua. Each\nevent has a set of event handlers, which are simply Lua functions called in\nthe order they were connected to an event. For example, if you created a\nmodule that needs to do something each time Textadept creates a new buffer,\nconnect a Lua function to the `events.BUFFER_NEW` event:\n\n events.connect(events.BUFFER_NEW, function()\n -- Do something here.\n end)\n\nEvents themselves are nothing special. You do not have to declare one before\nusing it. Events are simply strings containing arbitrary event names. When\neither you or Textadept emits an event, Textadept runs all event handlers\nconnected to the event, passing any given arguments to the event's handler\nfunctions. If an event handler explicitly returns a `true` or `false` boolean\nvalue, Textadept will not call subsequent handlers. This is useful if you\nwant to stop the propagation of an event like a keypress if your event\nhandler handled it.\n
@@ -596,7 +596,7 @@ find_next ui.find.find_next()\nMimics pressing the "Find Next" button.
find_next_button_text ui.find.find_next_button_text (string, Write-only)\nThe text of the "Find Next" button.\nThis is primarily used for localization.
find_prev ui.find.find_prev()\nMimics pressing the "Find Prev" button.
find_prev_button_text ui.find.find_prev_button_text (string, Write-only)\nThe text of the "Find Prev" button.\nThis is primarily used for localization.
-finish_mode ui.command_entry.finish_mode(f)\nExits the current key mode, closes the command entry, and calls function *f*\n(if given) with the command entry's text as an argument.\nThis is useful for binding keys to exit a command entry mode and perform an\naction with the entered text.\n@param f Optional function to call. It should accept the command entry text\n as an argument.\n@usage keys['\n'] =\n function() return ui.command_entry.finish_mode(ui.print) end
+finish_mode ui.command_entry.finish_mode(f)\nExits the current key mode, closes the command entry, and calls function *f*\n(if given) with the command entry's text as an argument.\nThis is useful for binding keys to exit a command entry mode and perform an\naction with the entered text.\n@param f Optional function to call. It should accept the command entry text\n as an argument.\n@usage keys['\\n'] =\n function() return ui.command_entry.finish_mode(ui.print) end
first_visible_line buffer.first_visible_line (number)\nThe line number of the line at the top of the view, starting from zero.
float lexer.float (pattern)\nA pattern that matches a floating point number.
floor math.floor(x)\nReturns the largest integral value smaller than or equal to `x`.
@@ -617,7 +617,7 @@ fold_line buffer.fold_line(buffer, line, action)\nContracts, expands, or toggles
fold_line_comments lexer.fold_line_comments(prefix)\nReturns a fold function (to be passed to `lexer.add_fold_point()`) that folds\nconsecutive line comments that start with string *prefix*.\n@param prefix The prefix string defining a line comment.\n@usage lex:add_fold_point(lexer.COMMENT, '--',\n lexer.fold_line_comments('--'))\n@usage lex:add_fold_point(lexer.COMMENT, '//',\n lexer.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.
+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.
get_cur_line buffer.get_cur_line(buffer)\nReturns the current line's text and the caret's position on that line,\nstarting from zero.\n@param buffer A buffer.\n@return string, number
@@ -1065,8 +1065,8 @@ size view.size (number)\nThe split resizer's pixel position if the view is a spl
snippets _G.snippets (table)\nMap of snippet triggers with their snippet text or functions that return such\ntext, with language-specific snippets tables assigned to a lexer name key.\nThis table also contains the `textadept.snippets` module.
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. 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
+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. 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
diff --git a/modules/lua/tadoc.lua b/modules/lua/tadoc.lua
index 6cd6983c..b964523c 100644
--- a/modules/lua/tadoc.lua
+++ b/modules/lua/tadoc.lua
@@ -104,7 +104,7 @@ local function write_apidoc(file, m, b)
end
end
-- Format the block documentation.
- doc = table.concat(doc, '\n'):gsub('\n', '\\n')
+ doc = table.concat(doc, '\n'):gsub('\\n', '\\\\n'):gsub('\n', '\\n')
file[#file + 1] = name:match('[^%.:]+$')..' '..doc
end