aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-01-22 12:06:36 -0500
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-01-22 12:06:36 -0500
commit6bb9274855236473226bdb2999b4143d78a37bcc (patch)
tree43b4c7db6d2f9bfadd277e0d77ff75e95a77e56d
parent8e530becaaa31eb5dcc7b8595c4b4bcb6c8bb958 (diff)
Compile, run, and build command functions can also return environment tables.
-rw-r--r--core/.os.luadoc2
-rw-r--r--docs/api.md25
-rw-r--r--modules/lua/ta_api14
-rw-r--r--modules/lua/ta_tags12
-rw-r--r--modules/textadept/run.lua29
-rw-r--r--test/test.lua19
6 files changed, 64 insertions, 37 deletions
diff --git a/core/.os.luadoc b/core/.os.luadoc
index 4405c4d1..8ce09344 100644
--- a/core/.os.luadoc
+++ b/core/.os.luadoc
@@ -16,7 +16,7 @@ module('os')
-- @param cwd Optional current working directory (cwd) for the child
-- process. When omitted, the parent's cwd is used.
-- @param env Optional map of environment variables for the child process.
--- When omitted, the parent's environment is used.
+-- When omitted, Textadept's environment is used.
-- @param stdout_cb Optional Lua function that accepts a string parameter for a
-- block of standard output read from the child. Stdout is read asynchronously
-- in 1KB or 0.5KB blocks (depending on the platform), or however much data is
diff --git a/docs/api.md b/docs/api.md
index d4f9f75b..db0b6dbe 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -6019,7 +6019,7 @@ Parameters:
* *`s`*: String or pattern start of a range.
* *`e`*: Optional string or pattern end of a range. The default value is *s*.
* *`single_line`*: Optional flag indicating whether or not the range must be
- on a single line.
+ on a single line. The default value is `false`.
* *`escapes`*: Optional flag indicating whether or not the range end may
be escaped by a '\' character.
The default value is `false` unless *s* and *e* are identical,
@@ -6051,8 +6051,8 @@ Parameters:
Usage:
-* `local preproc = token(lexer.PREPROCESSOR, lexer.starts_line('#') *
- lexer.nonnewline^0)`
+* `local preproc = token(lexer.PREPROCESSOR,
+ lexer.starts_line(lexer.to_eol('#')))`
Return:
@@ -6075,7 +6075,7 @@ Parameters:
Usage:
* `local line_comment = lexer.to_eol('//')`
-* `local line_comment = lexer.to_eol(P('#') + ';')`
+* `local line_comment = lexer.to_eol(S('#;'))`
Return:
@@ -6294,7 +6294,7 @@ Parameters:
* *`cwd`*: Optional current working directory (cwd) for the child
process. When omitted, the parent's cwd is used.
* *`env`*: Optional map of environment variables for the child process.
- When omitted, the parent's environment is used.
+ When omitted, Textadept's environment is used.
* *`stdout_cb`*: Optional Lua function that accepts a string parameter for a
block of standard output read from the child. Stdout is read asynchronously
in 1KB or 0.5KB blocks (depending on the platform), or however much data is
@@ -7425,8 +7425,9 @@ Stops the currently running process, if any.
Map of project root paths and "makefiles" to their associated "build" shell
command line strings or functions that return such strings.
-Functions may also return a working directory to operate in. By default, it
-is the project's root directory.
+Functions may also return a working directory and process environment table
+to operate in. By default, the working directory is the project's root
+directory and the environment is Textadept's environment.
<a id="textadept.run.compile_commands"></a>
#### `textadept.run.compile_commands`
@@ -7440,8 +7441,9 @@ Command line strings may have the following macros:
+ `%d`: The file's directory path.
+ `%p`: The file's full path.
-Functions may also return a working directory to operate in. By default, it
-is the current file's parent directory.
+Functions may also return a working directory and process environment table
+to operate in. By default, the working directory is the current file's parent
+directory and the environment is Textadept's environment.
<a id="textadept.run.error_patterns"></a>
#### `textadept.run.error_patterns`
@@ -7469,8 +7471,9 @@ Command line strings may have the following macros:
+ `%d`: The file's directory path.
+ `%p`: The file's full path.
-Functions may also return a working directory to operate in. By default, it
-is the current file's parent directory.
+Functions may also return a working directory and process environment table
+to operate in. By default, the working directory is the current file's parent
+directory and the environment is Textadept's environment.
---
<a id="textadept.session"></a>
diff --git a/modules/lua/ta_api b/modules/lua/ta_api
index 31721d33..edaf6115 100644
--- a/modules/lua/ta_api
+++ b/modules/lua/ta_api
@@ -386,7 +386,7 @@ buffer _G.buffer (table)\nThe current buffer in the current view.
buffer view.buffer (table)\nThe buffer the view currently contains. (Read-only)
buffer_statusbar_text ui.buffer_statusbar_text (string, Write-only)\nThe text displayed in the buffer statusbar.
build textadept.run.build(root_directory)\nBuilds the project whose root path is *root_directory* or the current project\nusing the shell command from the `build_commands` table.\nIf a "makefile" type of build file is found, prompts the user for the full\nbuild command.\nThe current project is determined by either the buffer's filename or the\ncurrent working directory.\nEmits `BUILD_OUTPUT` events.\n@param root_directory The path to the project to build. The default value is\n the current project.\n@see build_commands\n@see _G.events
-build_commands textadept.run.build_commands (table)\nMap of project root paths and "makefiles" to their associated "build" shell\ncommand line strings or functions that return such strings.\nFunctions may also return a working directory to operate in. By default, it\nis the project's root directory.
+build_commands textadept.run.build_commands (table)\nMap of project root paths and "makefiles" to their associated "build" shell\ncommand line strings or functions that return such strings.\nFunctions may also return a working directory and process environment table\nto operate in. By default, the working directory is the project's root\ndirectory and the environment is Textadept's environment.
call_tip_active view.call_tip_active(view)\nReturns whether or not a call tip is visible.\n@param view A view.\n@return bool
call_tip_cancel view.call_tip_cancel(view)\nRemoves the displayed call tip from view.\n@param view A view.
call_tip_fore_hlt view.call_tip_fore_hlt (number, Write-only)\nA call tip's highlighted text foreground color, in "0xBBGGRR" format.
@@ -437,7 +437,7 @@ column buffer.column (table, Read-only)\nTable of column numbers (taking tab wid
command_entry ui.command_entry (module)\nTextadept's Command Entry.\nIt supports multiple modes that each have their own functionality (such as\nrunning Lua code and filtering text through shell commands) and history.
comment_string textadept.editing.comment_string (table)\nMap of lexer names to line comment strings for programming languages, used by\nthe `toggle_comment()` function.\nKeys are lexer names and values are either the language's line comment\nprefixes or block comment delimiters separated by a '|' character.\n@see toggle_comment
compile textadept.run.compile(filename)\nCompiles file *filename* or the current file using an appropriate shell\ncommand from the `compile_commands` table.\nThe shell command is determined from the file's filename, extension, or\nlanguage in that order.\nEmits `COMPILE_OUTPUT` events.\n@param filename Optional path to the file to compile. The default value is\n the current file's filename.\n@see compile_commands\n@see _G.events
-compile_commands textadept.run.compile_commands (table)\nMap of filenames, file extensions, and lexer names to their associated\n"compile" shell command line strings or functions that return such 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.
+compile_commands textadept.run.compile_commands (table)\nMap of filenames, file extensions, and lexer names to their associated\n"compile" shell command line strings or functions that return such 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 and process environment table\nto operate in. By default, the working directory is the current file's parent\ndirectory and the environment is Textadept's environment.
connect events.connect(event, f, index)\nAdds function *f* to the set of event handlers for event *event* at position\n*index*.\nIf *index* not given, appends *f* to the set of handlers. *event* may be any\narbitrary string and does not need to have been previously defined.\n@param event The string event name.\n@param f The Lua function to connect to *event*.\n@param index Optional index to insert the handler into.\n@usage events.connect('my_event', function(msg) ui.print(msg) end)\n@see disconnect
constants _SCINTILLA.constants (table)\nMap of Scintilla constant names to their numeric values.\n@see _G.buffer
context_menu textadept.menu.context_menu (table)\nThe default right-click context menu.\nSubmenus, and menu items can be retrieved by name in addition to table index\nnumber.
@@ -771,7 +771,7 @@ quick_open io.quick_open(paths, filter, opts)\nPrompts the user to select files
quick_open_filters io.quick_open_filters (table)\nMap of directory paths to filters used by `io.quick_open()`.\n@see quick_open
quick_open_max io.quick_open_max (number)\nThe maximum number of files listed in the quick open dialog.\nThe default value is `1000`.
quit _G.quit()\nEmits a `QUIT` event, and unless any handler returns `false`, quits\nTextadept.\n@see events.QUIT
-range lexer.range(s, e, single_line, escapes, balanced)\nCreates and returns a pattern that matches a range of text bounded by strings\nor patterns *s* and *e*.\nThis is a convenience function for matching more complicated ranges like\nstrings with escape characters, balanced parentheses, and block comments\n(nested or not). *e* is optional and defaults to *s*. *single_line* indicates\nwhether or not the range must be on a single line; *escapes* indicates\nwhether or not to allow '\' as an escape character; and *balanced* indicates\nwhether or not to handle balanced ranges like parentheses, and requires *s*\nand *e* to be different.\n@param s String or pattern start of a range.\n@param e Optional string or pattern end of a range. The default value is *s*.\n@param single_line Optional flag indicating whether or not the range must be\n on a single line.\n@param escapes Optional flag indicating whether or not the range end may\n be escaped by a '\' character.\n The default value is `false` unless *s* and *e* are identical,\n single-character strings. In that case, the default value is `true`.\n@param balanced Optional flag indicating whether or not to match a balanced\n range, like the "%b" Lua pattern. This flag only applies if *s* and *e* are\n different.\n@usage local dq_str_escapes = lexer.range('"')\n@usage local dq_str_noescapes = lexer.range('"', false, false)\n@usage local unbalanced_parens = lexer.range('(', ')')\n@usage local balanced_parens = lexer.range('(', ')', false, false, true)\n@return pattern
+range lexer.range(s, e, single_line, escapes, balanced)\nCreates and returns a pattern that matches a range of text bounded by strings\nor patterns *s* and *e*.\nThis is a convenience function for matching more complicated ranges like\nstrings with escape characters, balanced parentheses, and block comments\n(nested or not). *e* is optional and defaults to *s*. *single_line* indicates\nwhether or not the range must be on a single line; *escapes* indicates\nwhether or not to allow '\' as an escape character; and *balanced* indicates\nwhether or not to handle balanced ranges like parentheses, and requires *s*\nand *e* to be different.\n@param s String or pattern start of a range.\n@param e Optional string or pattern end of a range. The default value is *s*.\n@param single_line Optional flag indicating whether or not the range must be\n on a single line. The default value is `false`.\n@param escapes Optional flag indicating whether or not the range end may\n be escaped by a '\' character.\n The default value is `false` unless *s* and *e* are identical,\n single-character strings. In that case, the default value is `true`.\n@param balanced Optional flag indicating whether or not to match a balanced\n range, like the "%b" Lua pattern. This flag only applies if *s* and *e* are\n different.\n@usage local dq_str_escapes = lexer.range('"')\n@usage local dq_str_noescapes = lexer.range('"', false, false)\n@usage local unbalanced_parens = lexer.range('(', ')')\n@usage local balanced_parens = lexer.range('(', ')', false, false, true)\n@return pattern
read spawn_proc:read(arg)\nReads and returns stdout from process *spawn_proc*, according to string\nformat or number *arg*.\nSimilar to Lua's `io.read()` and blocks for input. *spawn_proc* must still be\nrunning. If an error occurs while reading, returns `nil`, an error code, and\nan error message.\nEnsure any read operations read all stdout available, as the stdout callback\nfunction passed to `os.spawn()` will not be called until the stdout buffer is\nclear.\n@param arg Optional argument similar to those in Lua's `io.read()`, but "n"\n is not supported. The default value is "l", which reads a line.\n@return string of bytes read
read_only buffer.read_only (bool)\nWhether or not the buffer is read-only.\nThe default value is `false`.
recent_files io.recent_files (table)\nList of recently opened files, the most recent being towards the top.
@@ -807,7 +807,7 @@ rotate_selection buffer.rotate_selection(buffer)\nDesignates the next additional
run textadept.run (module)\nCompile and run source code files with Textadept.\nLanguage modules may tweak the `compile_commands`,\n`run_commands`, and `error_patterns` tables for particular languages.\nThe user may tweak `build_commands` for particular projects.
run textadept.run.run(filename)\nRuns file *filename* or the current file using an appropriate shell command\nfrom the `run_commands` table.\nThe shell command is determined from the file's filename, extension, or\nlanguage in that order.\nEmits `RUN_OUTPUT` events.\n@param filename Optional path to the file to run. The default value is the\n current file's filename.\n@see run_commands\n@see _G.events
run ui.command_entry.run(f, keys, lang, height)\nOpens the command entry, subjecting it to any key bindings defined in table\n*keys*, highlighting text with lexer name *lang*, and displaying\n*height* number of lines at a time, and then when the `Enter` key is pressed,\ncloses the command entry and calls function *f* (if non-`nil`) with the\ncommand entry's text as an argument.\nBy default with no arguments given, opens a Lua command entry.\nThe command entry does not respond to Textadept's default key bindings, but\ninstead to the key bindings defined in *keys* and in\n`ui.command_entry.editing_keys`.\n@param f Optional function to call upon pressing `Enter` in the command\n entry, ending the mode. It should accept the command entry text as an\n argument.\n@param keys Optional table of key bindings to respond to. This is in\n addition to the basic editing and movement keys defined in\n `ui.command_entry.editing_keys`.\n `Esc` and `Enter` are automatically defined to cancel and finish the\n command entry, respectively.\n This parameter may be omitted completely.\n@param lang 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 ui.command_entry.run(ui.print)\n@see editing_keys
-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_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 and process environment table\nto operate in. By default, the working directory is the current file's parent\ndirectory and the environment is Textadept's environment.
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`.
save buffer.save(buffer)\nSaves the buffer to its file.\nIf the buffer does not have a file, the user is prompted for one.\nEmits `FILE_BEFORE_SAVE` and `FILE_AFTER_SAVE` events.\n@param buffer A buffer.
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.
@@ -885,12 +885,12 @@ snippet textadept.editing.autocompleters.snippet (function)\nAutocompleter funct
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.
snippets textadept.snippets (module)\nSnippets for Textadept.
space lexer.space (pattern)\nA pattern that matches any whitespace character ('\t', '\v', '\f', '\\n',\n'\r', space).
-spawn os.spawn(cmd, cwd, env, stdout_cb, stderr_cb, exit_cb)\nSpawns an interactive child process *cmd* in a separate thread, returning\na handle to that process.\nOn Windows, *cmd* is passed to `cmd.exe`: `%COMSPEC% /c [cmd]`.\nAt the moment, only the Windows terminal version spawns processes in the same\nthread.\n@param cmd A command line string that contains the program's name followed by\n 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 map of environment variables for the child process.\n When omitted, the 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
+spawn os.spawn(cmd, cwd, env, stdout_cb, stderr_cb, exit_cb)\nSpawns an interactive child process *cmd* in a separate thread, returning\na handle to that process.\nOn Windows, *cmd* is passed to `cmd.exe`: `%COMSPEC% /c [cmd]`.\nAt the moment, only the Windows terminal version spawns processes in the same\nthread.\n@param cmd A command line string that contains the program's name followed by\n 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 map of environment variables for the child process.\n When omitted, Textadept'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
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_styling buffer.start_styling(buffer, position, unused)\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 unused Unused number. `0` can be safely used.\n@usage buffer:start_styling(1, 0)\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
+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,\n lexer.starts_line(lexer.to_eol('#')))\n@return pattern
status spawn_proc:status()\nReturns the status of process *spawn_proc*, which is either "running" or\n"terminated".\n@return "running" or "terminated"
statusbar_text ui.statusbar_text (string, Write-only)\nThe text displayed in the statusbar.
stop textadept.run.stop()\nStops the currently running process, if any.
@@ -945,7 +945,7 @@ textadept _G.textadept (module)\nThe textadept module.\nIt provides utilities fo
textbox ui.dialogs.textbox(options)\nPrompts the user with a multiple-line textbox dialog defined by dialog\noptions table *options*, returning the selected button's index.\nIf *options*.`string_output` is `true`, returns the selected button's label.\nIf *options*.`editable` is `true`, also returns the textbox's text. If the\ndialog 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 dialog.\n\n * `title`: The dialog's title text.\n * `informative_text`: The dialog's main message text.\n * `text`: The dialog's initial textbox text.\n * `text_from_file`: The filename whose contents are loaded into the\n textbox. This option has no effect when `text` is given.\n * `button1`: The right-most button's label. The default value is\n `_L['OK']`.\n * `button2`: The middle button's label.\n * `button3`: The left-most button's label. This option requires `button2`\n to be set.\n * `editable`: Allows the user to edit the textbox's text. The default value\n is `false`.\n * `focus_textbox`: Focus the textbox instead of the buttons. The default\n value is `false`.\n * `scroll_to`: Where to scroll the textbox's text.\n The available values are `"top"` and `"bottom"`. The default value is\n `"top"`.\n * `selected`: Select all of the textbox's text. The default value is\n `false`.\n * `monospaced_font`: Use a monospaced font in the textbox instead of a\n proportional one. The default value is `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@usage ui.dialogs.textbox{title = 'License Agreement',\n informative_text = 'You agree to:', text_from_file = _HOME..'/LICENSE'}\n@return selected button or exit code, textbox text
timeout _G.timeout(interval, f, ...)\nCalls function *f* with the given arguments after *interval* seconds.\nIf *f* returns `true`, calls *f* repeatedly every *interval* seconds as long\nas *f* returns `true`. A `nil` or `false` return value stops repetition.\n@param interval The interval in seconds to call *f* after.\n@param f The function to call.\n@param ... Additional arguments to pass to *f*.
title ui.title (string, Write-only)\nThe title text of Textadept's window.
-to_eol lexer.to_eol(prefix, escape)\nCreates and returns a pattern that matches from string or pattern *prefix*\nuntil the end of the line.\n*escape* indicates whether the end of the line can be escaped with a '\'\ncharacter.\n@param prefix String or pattern prefix to start matching at.\n@param escape Optional flag indicating whether or not newlines can be escaped\n by a '\' character. The default value is `false`.\n@usage local line_comment = lexer.to_eol('//')\n@usage local line_comment = lexer.to_eol(P('#') + ';')\n@return pattern
+to_eol lexer.to_eol(prefix, escape)\nCreates and returns a pattern that matches from string or pattern *prefix*\nuntil the end of the line.\n*escape* indicates whether the end of the line can be escaped with a '\'\ncharacter.\n@param prefix String or pattern prefix to start matching at.\n@param escape Optional flag indicating whether or not newlines can be escaped\n by a '\' character. The default value is `false`.\n@usage local line_comment = lexer.to_eol('//')\n@usage local line_comment = lexer.to_eol(S('#;'))\n@return pattern
toggle textadept.bookmarks.toggle()\nToggles a bookmark on the current line.
toggle_caret_sticky buffer.toggle_caret_sticky(buffer)\nCycles between `buffer.caret_sticky` option settings `buffer.CARETSTICKY_ON`\nand `buffer.CARETSTICKY_OFF`.\n@param buffer A buffer.\n@see caret_sticky
toggle_comment textadept.editing.toggle_comment()\nComments or uncomments the selected lines based on the current language.\nAs long as any part of a line is selected, the entire line is eligible for\ncommenting/uncommenting.\n@see comment_string
diff --git a/modules/lua/ta_tags b/modules/lua/ta_tags
index 0d3d8713..7e245f62 100644
--- a/modules/lua/ta_tags
+++ b/modules/lua/ta_tags
@@ -388,7 +388,7 @@ buffer _HOME/core/.view.luadoc /^local buffer$/;" t class:view
buffer _HOME/core/init.lua /^local buffer$/;" t
buffer_statusbar_text _HOME/core/ui.lua /^module('ui')]]$/;" F class:ui
build _HOME/modules/textadept/run.lua /^function M.build(root_directory)$/;" f class:textadept.run
-build_commands _HOME/modules/textadept/run.lua /^M.build_commands = {--[[Ant]]['build.xml']='ant',--[[Dockerfile]]Dockerfile='docker build .',--[[Make]]Makefile='make',GNUmakefile='make',makefile='make',--[[Maven]]['pom.xml']='mvn',--[[Ruby]]Rakefile='rake'}$/;" t class:textadept.run
+build_commands _HOME/modules/textadept/run.lua /^M.build_commands = {--[[Ant]]['build.xml']='ant',--[[Dockerfile]]Dockerfile='docker build .',--[[Make]]Makefile='make',GNUmakefile='make',makefile='make',--[[Meson]]['meson.build']='meson compile',--[[Maven]]['pom.xml']='mvn',--[[Ruby]]Rakefile='rake'}$/;" t class:textadept.run
call_tip_active _HOME/core/.view.luadoc /^function call_tip_active(view) end$/;" f class:view
call_tip_cancel _HOME/core/.view.luadoc /^function call_tip_cancel(view) end$/;" f class:view
call_tip_fore_hlt _HOME/core/.view.luadoc /^module('view')$/;" F class:view
@@ -437,9 +437,9 @@ colors _HOME/lexers/lexer.lua /^M.colors = setmetatable({}, {$/;" t class:lexer
colorselect _HOME/core/.ui.dialogs.luadoc /^function colorselect(options) end$/;" f class:ui.dialogs
column _HOME/core/.buffer.luadoc /^module('buffer')$/;" F class:buffer
command_entry _HOME/modules/textadept/command_entry.lua /^module('ui.command_entry')]]$/;" m class:ui
-comment_string _HOME/modules/textadept/editing.lua /^M.comment_string = {actionscript='//',ada='--',apdl='!',ansi_c='/*|*/',antlr='//',apl='#',applescript='--',asp='\'',autoit=';',awk='#',b_lang='//',bash='#',batch=':',bibtex='%',boo='#',chuck='//',cmake='#',coffeescript='#',context='%',cpp='//',crystal='#',csharp='//',css='/*|*/',cuda='//',desktop='#',django='{#|#}',dmd='//',dockerfile='#',dot='//',eiffel='--',elixir='#',erlang='%',faust='//',fennel=';',fish='#',forth='|\\',fortran='!',fsharp='//',gap='#',gettext='#',gherkin='#',glsl='//',gnuplot='#',go='//',groovy='//',gtkrc='#',haskell='--',html='<!--|-->',icon='#',idl='//',inform='!',ini='#',Io='#',java='//',javascript='//',jq='#',json='/*|*/',jsp='//',latex='%',ledger='#',less='//',lilypond='%',lisp=';',logtalk='%',lua='--',makefile='#',matlab='#',moonscript='--',myrddin='//',nemerle='//',nim='#',nsis='#',objective_c='//',pascal='//',perl='#',php='//',pico8='//',pike='//',pkgbuild='#',prolog='%',props='#',protobuf='//',ps='%',pure='//',python='#',rails='#',rc='#',rebol=';',rest='.. ',rexx='--',rhtml='<!--|-->',rstats='#',ruby='#',rust='//',sass='//',scala='//',scheme=';',smalltalk='"|"',sml='(*)',snobol4='#',sql='--',tcl='#',tex='%',text='',toml='#',vala='//',vb='\'',vbscript='\'',verilog='//',vhdl='--',wsf='<!--|-->',xml='<!--|-->',yaml='#'}$/;" t class:textadept.editing
+comment_string _HOME/modules/textadept/editing.lua /^M.comment_string = {actionscript='//',ada='--',apdl='!',ansi_c='/*|*/',antlr='//',apl='#',applescript='--',asp='\'',autoit=';',awk='#',b_lang='//',bash='#',batch=':',bibtex='%',boo='#',chuck='//',clojure=';',cmake='#',coffeescript='#',context='%',cpp='//',crystal='#',csharp='//',css='/*|*/',cuda='//',desktop='#',django='{#|#}',dmd='//',dockerfile='#',dot='//',eiffel='--',elixir='#',elm='--',erlang='%',fantom='//',faust='//',fennel=';',fish='#',forth='|\\',fortran='!',fsharp='//',fstab='#',gap='#',gettext='#',gherkin='#',glsl='//',gnuplot='#',go='//',groovy='//',gtkrc='#',haskell='--',html='<!--|-->',icon='#',idl='//',inform='!',ini='#',Io='#',java='//',javascript='//',jq='#',json='/*|*/',jsp='//',julia='#',latex='%',ledger='#',less='//',lilypond='%',lisp=';',logtalk='%',lua='--',makefile='#',matlab='#',meson='#',moonscript='--',myrddin='//',nemerle='//',networkd='#',nim='#',nsis='#',objective_c='//',pascal='//',perl='#',php='//',pico8='//',pike='//',pkgbuild='#',pony='//',prolog='%',props='#',protobuf='//',ps='%',pure='//',python='#',rails='#',rc='#',reason='//',rebol=';',rest='.. ',rexx='--',rhtml='<!--|-->',routeros='#',rstats='#',ruby='#',rust='//',sass='//',scala='//',scheme=';',smalltalk='"|"',sml='(*)',snobol4='#',spin="'",sql='--',systemd='#',tcl='#',tex='%',text='',toml='#',vala='//',vb='\'',vbscript='\'',verilog='//',vhdl='--',wsf='<!--|-->',xml='<!--|-->',xs='#',xtend='//',yaml='#',zig='//'}$/;" t class:textadept.editing
compile _HOME/modules/textadept/run.lua /^function M.compile(filename)$/;" f class:textadept.run
-compile_commands _HOME/modules/textadept/run.lua /^M.compile_commands = {actionscript='mxmlc "%f"',ada='gnatmake "%f"',ansi_c='gcc -o "%e" "%f"',antlr='antlr4 "%f"',g='antlr3 "%f"',applescript='osacompile "%f" -o "%e.scpt"',asm='nasm "%f"'--[[ && ld "%e.o" -o "%e"']],boo='booc "%f"',caml='ocamlc -o "%e" "%f"',csharp=WIN32 and 'csc "%f"' or 'mcs "%f"',coffeescript='coffee -c "%f"',context='context --nonstopmode "%f"',cpp='g++ -o "%e" "%f"',cuda=WIN32 and 'nvcc -o "%e.exe" "%f"' or 'nvcc -o "%e" "%f"',dmd='dmd "%f"',dot='dot -Tps "%f" -o "%e.ps"',eiffel='se c "%f"',elixir='elixirc "%f"',erlang='erl -compile "%e"',faust='faust -o "%e.cpp" "%f"',fsharp=WIN32 and 'fsc.exe "%f"' or 'mono fsc.exe "%f"',fortran='gfortran -o "%e" "%f"',gap='gac -o "%e" "%f"',go='go build "%f"',groovy='groovyc "%f"',haskell=WIN32 and 'ghc -o "%e.exe" "%f"' or 'ghc -o "%e" "%f"',inform=function() return 'inform -c "'..buffer.filename:match('^(.+%.inform[/\\])Source')..'"' end,java='javac "%f"',ltx='pdflatex -file-line-error -halt-on-error "%f"',less='lessc --no-color "%f" "%e.css"',lilypond='lilypond "%f"',lisp='clisp -c "%f"',litcoffee='coffee -c "%f"',lua='luac -o "%e.luac" "%f"',moon='moonc "%f"',markdown='markdown "%f" > "%e.html"',myr='mbld -b "%e" "%f"',nemerle='ncc "%f" -out:"%e.exe"',nim='nim c "%f"',nsis='MakeNSIS "%f"',objective_c='gcc -o "%e" "%f"',pascal='fpc "%f"',perl='perl -c "%f"',php='php -l "%f"',prolog='gplc --no-top-level "%f"',python='python -m py_compile "%f"',ruby='ruby -c "%f"',rust='rustc "%f"',sass='sass "%f" "%e.css"',scala='scalac "%f"',sml='mlton "%f"',tex='pdflatex -file-line-error -halt-on-error "%f"',vala='valac "%f"',vb=WIN32 and 'vbc "%f"' or 'vbnc "%f"',}$/;" t class:textadept.run
+compile_commands _HOME/modules/textadept/run.lua /^M.compile_commands = {actionscript='mxmlc "%f"',ada='gnatmake "%f"',ansi_c='gcc -o "%e" "%f"',antlr='antlr4 "%f"',g='antlr3 "%f"',applescript='osacompile "%f" -o "%e.scpt"',asm='nasm "%f"'--[[ && ld "%e.o" -o "%e"']],boo='booc "%f"',caml='ocamlc -o "%e" "%f"',csharp=WIN32 and 'csc "%f"' or 'mcs "%f"',coffeescript='coffee -c "%f"',context='context --nonstopmode "%f"',cpp='g++ -o "%e" "%f"',cuda=WIN32 and 'nvcc -o "%e.exe" "%f"' or 'nvcc -o "%e" "%f"',dmd='dmd "%f"',dot='dot -Tps "%f" -o "%e.ps"',eiffel='se c "%f"',elixir='elixirc "%f"',erlang='erl -compile "%e"',faust='faust -o "%e.cpp" "%f"',fsharp=WIN32 and 'fsc.exe "%f"' or 'mono fsc.exe "%f"',fortran='gfortran -o "%e" "%f"',gap='gac -o "%e" "%f"',go='go build "%f"',groovy='groovyc "%f"',haskell=WIN32 and 'ghc -o "%e.exe" "%f"' or 'ghc -o "%e" "%f"',inform=function() return 'inform -c "'..buffer.filename:match('^(.+%.inform[/\\])Source')..'"' end,java='javac "%f"',ltx='pdflatex -file-line-error -halt-on-error "%f"',less='lessc --no-color "%f" "%e.css"',lilypond='lilypond "%f"',lisp='clisp -c "%f"',litcoffee='coffee -c "%f"',lua='luac -o "%e.luac" "%f"',moon='moonc "%f"',markdown='markdown "%f" > "%e.html"',myr='mbld -b "%e" "%f"',nemerle='ncc "%f" -out:"%e.exe"',nim='nim c "%f"',nsis='MakeNSIS "%f"',objective_c='gcc -o "%e" "%f"',pascal='fpc "%f"',perl='perl -c "%f"',php='php -l "%f"',pony='ponyc "%f"',prolog='gplc --no-top-level "%f"',python='python -m py_compile "%f"',ruby='ruby -c "%f"',rust='rustc "%f"',sass='sass "%f" "%e.css"',scala='scalac "%f"',sml='mlton "%f"',tex='pdflatex -file-line-error -halt-on-error "%f"',vala='valac "%f"',vb=WIN32 and 'vbc "%f"' or 'vbnc "%f"',zig='zig build-exe "%f"'}$/;" t class:textadept.run
connect _HOME/core/events.lua /^function M.connect(event, f, index)$/;" f class:events
constants _HOME/core/iface.lua /^M.constants = {ACCESSIBILITY_DISABLED=0,ACCESSIBILITY_ENABLED=1,ALPHA_NOALPHA=256,ALPHA_OPAQUE=255,ALPHA_TRANSPARENT=0,ANNOTATION_BOXED=2,ANNOTATION_HIDDEN=0,ANNOTATION_INDENTED=3,ANNOTATION_STANDARD=1,AUTOMATICFOLD_CHANGE=0x0004,AUTOMATICFOLD_CLICK=0x0002,AUTOMATICFOLD_SHOW=0x0001,CARETSTICKY_OFF=0,CARETSTICKY_ON=1,CARETSTICKY_WHITESPACE=2,CARETSTYLE_BLOCK=2,CARETSTYLE_BLOCK_AFTER=0x100,CARETSTYLE_INS_MASK=0xF,CARETSTYLE_INVISIBLE=0,CARETSTYLE_LINE=1,CARETSTYLE_OVERSTRIKE_BAR=0,CARETSTYLE_OVERSTRIKE_BLOCK=0x10,CARET_EVEN=0x08,CARET_JUMPS=0x10,CARET_SLOP=0x01,CARET_STRICT=0x04,CASEINSENSITIVEBEHAVIOR_IGNORECASE=1,CASEINSENSITIVEBEHAVIOR_RESPECTCASE=0,CASE_CAMEL=3,CASE_LOWER=2,CASE_MIXED=0,CASE_UPPER=1,CHARACTERSOURCE_DIRECT_INPUT=0,CHARACTERSOURCE_IME_RESULT=2,CHARACTERSOURCE_TENTATIVE_INPUT=1,CP_UTF8=65001,CURSORARROW=2,CURSORNORMAL=-1,CURSORREVERSEARROW=7,CURSORWAIT=4,EDGE_BACKGROUND=2,EDGE_LINE=1,EDGE_MULTILINE=3,EDGE_NONE=0,EOLANNOTATION_BOXED=2,EOLANNOTATION_HIDDEN=0,EOLANNOTATION_STANDARD=1,EOL_CR=1,EOL_CRLF=0,EOL_LF=2,FIND_CXX11REGEX=0x00800000,FIND_MATCHCASE=0x4,FIND_NONE=0x0,FIND_REGEXP=10485760,FIND_WHOLEWORD=0x2,FIND_WORDSTART=0x00100000,FOLDACTION_CONTRACT=0,FOLDACTION_EXPAND=1,FOLDACTION_TOGGLE=2,FOLDDISPLAYTEXT_BOXED=2,FOLDDISPLAYTEXT_HIDDEN=0,FOLDDISPLAYTEXT_STANDARD=1,FOLDFLAG_LEVELNUMBERS=0x0040,FOLDFLAG_LINEAFTER_CONTRACTED=0x0010,FOLDFLAG_LINEAFTER_EXPANDED=0x0008,FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004,FOLDFLAG_LINEBEFORE_EXPANDED=0x0002,FOLDFLAG_LINESTATE=0x0080,FOLDLEVELBASE=0x400,FOLDLEVELHEADERFLAG=0x2000,FOLDLEVELNUMBERMASK=0x0FFF,FOLDLEVELWHITEFLAG=0x1000,IDLESTYLING_AFTERVISIBLE=2,IDLESTYLING_ALL=3,IDLESTYLING_NONE=0,IDLESTYLING_TOVISIBLE=1,IME_INLINE=1,IME_WINDOWED=0,INDICATOR_CONTAINER=9,INDICATOR_IME=33,INDICATOR_IME_MAX=36,INDICATOR_MAX=36,INDIC_BOX=6,INDIC_COMPOSITIONTHICK=14,INDIC_COMPOSITIONTHIN=15,INDIC_CONTAINER=8,INDIC_DASH=9,INDIC_DIAGONAL=3,INDIC_DOTBOX=12,INDIC_DOTS=10,INDIC_FULLBOX=16,INDIC_GRADIENT=20,INDIC_GRADIENTCENTER=21,INDIC_HIDDEN=5,INDIC_IME=32,INDIC_IME_MAX=35,INDIC_MAX=35,INDIC_PLAIN=0,INDIC_POINT=18,INDIC_POINTCHARACTER=19,INDIC_ROUNDBOX=7,INDIC_SQUIGGLE=1,INDIC_SQUIGGLELOW=11,INDIC_SQUIGGLEPIXMAP=13,INDIC_STRAIGHTBOX=8,INDIC_STRIKE=4,INDIC_TEXTFORE=17,INDIC_TT=2,IV_LOOKBOTH=3,IV_LOOKFORWARD=2,IV_NONE=0,IV_REAL=1,LASTSTEPINUNDOREDO=0x100,MARGINOPTION_NONE=0,MARGINOPTION_SUBLINESELECT=1,MARGIN_BACK=2,MARGIN_COLOR=6,MARGIN_FORE=3,MARGIN_NUMBER=1,MARGIN_RTEXT=5,MARGIN_SYMBOL=0,MARGIN_TEXT=4,MARKER_MAX=32,MARKNUM_FOLDER=31,MARKNUM_FOLDEREND=26,MARKNUM_FOLDERMIDTAIL=28,MARKNUM_FOLDEROPEN=32,MARKNUM_FOLDEROPENMID=27,MARKNUM_FOLDERSUB=30,MARKNUM_FOLDERTAIL=29,MARK_ARROW=2,MARK_ARROWDOWN=6,MARK_ARROWS=24,MARK_AVAILABLE=28,MARK_BACKGROUND=22,MARK_BOOKMARK=31,MARK_BOXMINUS=14,MARK_BOXMINUSCONNECTED=15,MARK_BOXPLUS=12,MARK_BOXPLUSCONNECTED=13,MARK_CHARACTER=10000,MARK_CIRCLE=0,MARK_CIRCLEMINUS=20,MARK_CIRCLEMINUSCONNECTED=21,MARK_CIRCLEPLUS=18,MARK_CIRCLEPLUSCONNECTED=19,MARK_DOTDOTDOT=23,MARK_EMPTY=5,MARK_FULLRECT=26,MARK_LCORNER=10,MARK_LCORNERCURVE=16,MARK_LEFTRECT=27,MARK_MINUS=7,MARK_PIXMAP=25,MARK_PLUS=8,MARK_RGBAIMAGE=30,MARK_ROUNDRECT=1,MARK_SHORTARROW=4,MARK_SMALLRECT=3,MARK_TCORNER=11,MARK_TCORNERCURVE=17,MARK_UNDERLINE=29,MARK_VERTICALBOOKMARK=32,MARK_VLINE=9,MASK_FOLDERS=0xFE000000,MAX_MARGIN=5,MODEVENTMASKALL=0x7FFFFF,MOD_ALT=4,MOD_BEFOREDELETE=0x800,MOD_BEFOREINSERT=0x400,MOD_CHANGEANNOTATION=0x20000,MOD_CHANGEEOLANNOTATION=0x400000,MOD_CHANGEFOLD=0x8,MOD_CHANGEINDICATOR=0x4000,MOD_CHANGELINESTATE=0x8000,MOD_CHANGEMARGIN=0x10000,MOD_CHANGEMARKER=0x200,MOD_CHANGESTYLE=0x4,MOD_CHANGETABSTOPS=0x200000,MOD_CONTAINER=0x40000,MOD_CTRL=2,MOD_DELETETEXT=0x2,MOD_INSERTCHECK=0x100000,MOD_INSERTTEXT=0x1,MOD_LEXERSTATE=0x80000,MOD_META=16,MOD_NONE=0x0,MOD_NORM=0,MOD_SHIFT=1,MOD_SUPER=8,MOUSE_DRAG=2,MOUSE_PRESS=1,MOUSE_RELEASE=3,MULTIAUTOC_EACH=1,MULTIAUTOC_ONCE=0,MULTILINEUNDOREDO=0x1000,MULTIPASTE_EACH=1,MULTIPASTE_ONCE=0,MULTISTEPUNDOREDO=0x80,ORDER_CUSTOM=2,ORDER_PERFORMSORT=1,ORDER_PRESORTED=0,PERFORMED_REDO=0x40,PERFORMED_UNDO=0x20,PERFORMED_USER=0x10,SEL_LINES=2,SEL_RECTANGLE=1,SEL_STREAM=0,SEL_THIN=3,STARTACTION=0x2000,STYLE_BRACEBAD=36,STYLE_BRACELIGHT=35,STYLE_CALLTIP=39,STYLE_CONTROLCHAR=37,STYLE_DEFAULT=33,STYLE_FOLDDISPLAYTEXT=40,STYLE_INDENTGUIDE=38,STYLE_LASTPREDEFINED=40,STYLE_LINENUMBER=34,STYLE_MAX=256,TD_LONGARROW=0,TD_STRIKEOUT=1,TIME_FOREVER=10000000,UNDO_NONE=0,UPDATE_CONTENT=0x1,UPDATE_H_SCROLL=0x8,UPDATE_SELECTION=0x2,UPDATE_V_SCROLL=0x4,VISIBLE_SLOP=0x01,VISIBLE_STRICT=0x04,VS_NONE=0,VS_NOWRAPLINESTART=4,VS_RECTANGULARSELECTION=1,VS_USERACCESSIBLE=2,WRAPINDENT_DEEPINDENT=3,WRAPINDENT_FIXED=0,WRAPINDENT_INDENT=2,WRAPINDENT_SAME=1,WRAPVISUALFLAGLOC_DEFAULT=0x0000,WRAPVISUALFLAGLOC_END_BY_TEXT=0x0001,WRAPVISUALFLAGLOC_START_BY_TEXT=0x0002,WRAPVISUALFLAG_END=0x0001,WRAPVISUALFLAG_MARGIN=0x0004,WRAPVISUALFLAG_NONE=0x0000,WRAPVISUALFLAG_START=0x0002,WRAP_CHAR=2,WRAP_NONE=0,WRAP_WHITESPACE=3,WRAP_WORD=1,WS_INVISIBLE=0,WS_VISIBLEAFTERINDENT=2,WS_VISIBLEALWAYS=1,WS_VISIBLEONLYININDENT=3}$/;" t class:_SCINTILLA
context_menu _HOME/core/ui.lua /^module('ui')]]$/;" F class:ui
@@ -498,12 +498,12 @@ eol_annotation_style _HOME/core/.buffer.luadoc /^module('buffer')$/;" F class:bu
eol_annotation_text _HOME/core/.buffer.luadoc /^module('buffer')$/;" F class:buffer
eol_annotation_visible _HOME/core/.view.luadoc /^module('view')$/;" F class:view
eol_mode _HOME/core/.buffer.luadoc /^module('buffer')$/;" F class:buffer
-error_patterns _HOME/modules/textadept/run.lua /^M.error_patterns = {actionscript={'^(.-)%((%d+)%): col: (%d+) (.+)$'},ada={'^(.-):(%d+):(%d+):%s*(.*)$','^[^:]+: (.-):(%d+) (.+)$'},ansi_c={'^(.-):(%d+):(%d+): (.+)$'},antlr={'^error%(%d+%): (.-):(%d+):(%d+): (.+)$','^warning%(%d+%): (.-):(%d+):(%d+): (.+)$'},--[[ANTLR]]g={'^error%(%d+%): (.-):(%d+):(%d+): (.+)$','^warning%(%d+%): (.-):(%d+):(%d+): (.+)$'},asm={'^(.-):(%d+): (.+)$'},awk={'^awk: (.-):(%d+): (.+)$'},boo={'^(.-)%((%d+),(%d+)%): (.+)$'},caml={'^%s*File "(.-)", line (%d+), characters (%d+)'},chuck={'^(.-)line%((%d+)%)%.char%((%d+)%): (.+)$'},cmake={'^CMake Error at (.-):(%d+)','^(.-):(%d+):$'},coffeescript={'^(.-):(%d+):(%d+): (.+)$'},context={'error on line (%d+) in file (.-): (.+)$'},cpp={'^(.-):(%d+):(%d+): (.+)$'},csharp={'^(.-)%((%d+),(%d+)%): (.+)$'},cuda={'^(.-)%((%d+)%): (error.+)$'},dart={"^'(.-)': error: line (%d+) pos (%d+): (.+)$",'%(file://(.-):(%d+):(%d+)%)'},dmd={'^(.-)%((%d+)%): (Error.+)$'},dot={'^Warning: (.-): (.+) in line (%d+)'},eiffel={'^Line (%d+) columns? .- in .- %((.-)%):$','^line (%d+) column (%d+) file (.-)$'},elixir={'^(.-):(%d+): (.+)$','Error%) (.-):(%d+): (.+)$'},erlang={'^(.-):(%d+): (.+)$'},faust={'^(.-):(%d+):(.+)$'},fennel={'^%S+ error in (.-):(%d+)'},forth={'^(.-):(%d+): (.+)$'},fortran={'^(.-):(%d+)%D+(%d+):%s*(.*)$'},fsharp={'^(.-)%((%d+),(%d+)%): (.+)$'},gap={'^(.+) in (.-) line (%d+)$'},gnuplot={'^"(.-)", line (%d+): (.+)$'},go={'^(.-):(%d+):(%d+): (.+)$'},groovy={'^%s+at .-%((.-):(%d+)%)$','^(.-):(%d+): (.+)$'},haskell={'^(.-):(%d+):(%d+):%s*(.*)$'},icon={'^File (.-); Line (%d+) # (.+)$','^.-from line (%d+) in (.-)$'},java={'^%s+at .-%((.-):(%d+)%)$','^(.-):(%d+): (.+)$'},javascript={'^%s+at .-%((.-):(%d+):(%d+)%)$','^%s+at (.-):(%d+):(%d+)$','^(.-):(%d+):?$'},jq={'^jq: error: (.+) at (.-), line (%d+)'},ltx={'^(.-):(%d+): (.+)$'},less={'^(.+) in (.-) on line (%d+), column (%d+):$'},lilypond={'^(.-):(%d+):(%d+):%s*(.*)$'},litcoffee={'^(.-):(%d+):(%d+): (.+)$'},lua={'^luac?: (.-):(%d+): (.+)$'},makefile={'^(.-):(%d+): (.+)$'},nemerle={'^(.-)%((%d+),(%d+)%): (.+)$'},nim={'^(.-)%((%d+), (%d+)%) (%w+:.+)$'},objective_c={'^(.-):(%d+):(%d+): (.+)$'},pascal={'^(.-)%((%d+),(%d+)%) (%w+:.+)$'},perl={'^(.+) at (.-) line (%d+)'},php={'^(.+) in (.-) on line (%d+)$'},pike={'^(.-):(%d+):(.+)$'},prolog={'^(.-):(%d+):(%d+): (.+)$','^(.-):(%d+): (.+)$'},pure={'^(.-), line (%d+): (.+)$'},python={'^%s*File "(.-)", line (%d+)'},rexx={'^Error %d+ running "(.-)", line (%d+): (.+)$'},ruby={'^%s+from (.-):(%d+):','^(.-):(%d+):%s*(.+)$'},rust={'^(.-):(%d+):(%d+): (.+)$',"panicked at '([^']+)', (.-):(%d+)"},sass={'^WARNING on line (%d+) of (.-):$','^%s+on line (%d+) of (.-)$'},scala={'^%s+at .-%((.-):(%d+)%)$','^(.-):(%d+): (.+)$'},sh={'^(.-): (%d+): %1: (.+)$'},bash={'^(.-): line (%d+): (.+)$'},zsh={'^(.-):(%d+): (.+)$'},smalltalk={'^(.-):(%d+): (.+)$','%((.-):(%d+)%)$'},snobol4={'^(.-):(%d+): (.+)$'},tcl={'^%s*%(file "(.-)" line (%d+)%)$'},tex={'^(.-):(%d+): (.+)$'},vala={'^(.-):(%d+)%.(%d+)[%-%.%d]+: (.+)$','^(.-):(%d+):(%d+): (.+)$'},vb={'^(.-)%((%d+),(%d+)%): (.+)$'}}$/;" t class:textadept.run
+error_patterns _HOME/modules/textadept/run.lua /^M.error_patterns = {actionscript={'^(.-)%((%d+)%): col: (%d+) (.+)$'},ada={'^(.-):(%d+):(%d+):%s*(.*)$','^[^:]+: (.-):(%d+) (.+)$'},ansi_c={'^(.-):(%d+):(%d+): (.+)$'},antlr={'^error%(%d+%): (.-):(%d+):(%d+): (.+)$','^warning%(%d+%): (.-):(%d+):(%d+): (.+)$'},--[[ANTLR]]g={'^error%(%d+%): (.-):(%d+):(%d+): (.+)$','^warning%(%d+%): (.-):(%d+):(%d+): (.+)$'},asm={'^(.-):(%d+): (.+)$'},awk={'^awk: (.-):(%d+): (.+)$'},boo={'^(.-)%((%d+),(%d+)%): (.+)$'},caml={'^%s*File "(.-)", line (%d+), characters (%d+)'},chuck={'^(.-)line%((%d+)%)%.char%((%d+)%): (.+)$'},clojure={' error .- at .-%((.-):(%d+)'},cmake={'^CMake Error at (.-):(%d+)','^(.-):(%d+):$'},coffeescript={'^(.-):(%d+):(%d+): (.+)$'},context={'error on line (%d+) in file (.-): (.+)$'},cpp={'^(.-):(%d+):(%d+): (.+)$'},csharp={'^(.-)%((%d+),(%d+)%): (.+)$'},cuda={'^(.-)%((%d+)%): (error.+)$'},dart={"^'(.-)': error: line (%d+) pos (%d+): (.+)$",'%(file://(.-):(%d+):(%d+)%)'},dmd={'^(.-)%((%d+)%): (Error.+)$'},dot={'^Warning: (.-): (.+) in line (%d+)'},eiffel={'^Line (%d+) columns? .- in .- %((.-)%):$','^line (%d+) column (%d+) file (.-)$'},elixir={'^(.-):(%d+): (.+)$','Error%) (.-):(%d+): (.+)$'},erlang={'^(.-):(%d+): (.+)$'},fantom={'^(.-)%((%d+),(%d+)%): (.+)$'},faust={'^(.-):(%d+):(.+)$'},fennel={'^%S+ error in (.-):(%d+)'},forth={'^(.-):(%d+): (.+)$'},fortran={'^(.-):(%d+)%D+(%d+):%s*(.*)$'},fsharp={'^(.-)%((%d+),(%d+)%): (.+)$'},gap={'^(.+) in (.-) line (%d+)$'},gnuplot={'^"(.-)", line (%d+): (.+)$'},go={'^(.-):(%d+):(%d+): (.+)$'},groovy={'^%s+at .-%((.-):(%d+)%)$','^(.-):(%d+): (.+)$'},haskell={'^(.-):(%d+):(%d+):%s*(.*)$'},icon={'^File (.-); Line (%d+) # (.+)$','^.-from line (%d+) in (.-)$'},java={'^%s+at .-%((.-):(%d+)%)$','^(.-):(%d+): (.+)$'},javascript={'^%s+at .-%((.-):(%d+):(%d+)%)$','^%s+at (.-):(%d+):(%d+)$','^(.-):(%d+):?$'},jq={'^jq: error: (.+) at (.-), line (%d+)'},julia={'^%s+%[%d+%].- at (.-):(%d+)$'},ltx={'^(.-):(%d+): (.+)$'},less={'^(.+) in (.-) on line (%d+), column (%d+):$'},lilypond={'^(.-):(%d+):(%d+):%s*(.*)$'},litcoffee={'^(.-):(%d+):(%d+): (.+)$'},lua={'^luac?: (.-):(%d+): (.+)$'},makefile={'^(.-):(%d+): (.+)$'},nemerle={'^(.-)%((%d+),(%d+)%): (.+)$'},nim={'^(.-)%((%d+), (%d+)%) (%w+:.+)$'},objective_c={'^(.-):(%d+):(%d+): (.+)$'},pascal={'^(.-)%((%d+),(%d+)%) (%w+:.+)$'},perl={'^(.+) at (.-) line (%d+)'},php={'^(.+) in (.-) on line (%d+)$'},pike={'^(.-):(%d+):(.+)$'},pony={'^(.-):(%d+):(%d+): (.+)$'},prolog={'^(.-):(%d+):(%d+): (.+)$','^(.-):(%d+): (.+)$'},pure={'^(.-), line (%d+): (.+)$'},python={'^%s*File "(.-)", line (%d+)'},rexx={'^Error %d+ running "(.-)", line (%d+): (.+)$'},ruby={'^%s+from (.-):(%d+):','^(.-):(%d+):%s*(.+)$'},rust={'^(.-):(%d+):(%d+): (.+)$',"panicked at '([^']+)', (.-):(%d+)"},sass={'^WARNING on line (%d+) of (.-):$','^%s+on line (%d+) of (.-)$'},scala={'^%s+at .-%((.-):(%d+)%)$','^(.-):(%d+): (.+)$'},sh={'^(.-): (%d+): %1: (.+)$'},bash={'^(.-): line (%d+): (.+)$'},zsh={'^(.-):(%d+): (.+)$'},smalltalk={'^(.-):(%d+): (.+)$','%((.-):(%d+)%)$'},snobol4={'^(.-):(%d+): (.+)$'},tcl={'^%s*%(file "(.-)" line (%d+)%)$'},tex={'^(.-):(%d+): (.+)$'},vala={'^(.-):(%d+)%.(%d+)[%-%.%d]+: (.+)$','^(.-):(%d+):(%d+): (.+)$'},vb={'^(.-)%((%d+),(%d+)%): (.+)$'},xs={'^(.-):(%d+)%S* (.+)$'},zig={'^(.-):(%d+):(%d+): (.+)$'}}$/;" t class:textadept.run
events _HOME/core/events.lua /^module('events')]]$/;" m
events _HOME/core/iface.lua /^M.events = {[2000]={"style_needed","position"},[2001]={"char_added","ch","character_source"},[2002]={"save_point_reached"},[2003]={"save_point_left"},[2004]={"modify_attempt_ro"},[2005]={"key","ch","modifiers"},[2006]={"double_click","position","line","modifiers"},[2007]={"update_ui","updated"},[2008]={"modified","position","modification_type","text","length","lines_added","line","fold_level_now","fold_level_prev","token","annotation_lines_added"},[2009]={"macro_record","message","w_param","l_param"},[2010]={"margin_click","margin","position","modifiers"},[2011]={"need_shown","position","length"},[2013]={"painted"},[2014]={"user_list_selection","list_type","text","position","ch","list_completion_method"},[2015]={"uri_dropped","text"},[2016]={"dwell_start","position","x","y"},[2017]={"dwell_end","position","x","y"},[2018]={"zoom"},[2019]={"hot_spot_click","position","modifiers"},[2020]={"hot_spot_double_click","position","modifiers"},[2021]={"call_tip_click","position"},[2022]={"auto_c_selection","text","position","ch","list_completion_method"},[2023]={"indicator_click","position","modifiers"},[2024]={"indicator_release","position","modifiers"},[2025]={"auto_c_cancelled"},[2026]={"auto_c_char_deleted"},[2027]={"hot_spot_release_click","position","modifiers"},[2028]={"focus_in"},[2029]={"focus_out"},[2030]={"auto_c_completed","text","position","ch","list_completion_method"},[2031]={"margin_right_click","margin","position","modifiers"},[2032]={"auto_c_selection_change","list_type","text","position"},}$/;" t class:_SCINTILLA
expr_types _HOME/modules/lua/init.lua /^M.expr_types = {['^[\'"]'] = 'string', ['^io%.p?open%s*%b()%s*$'] = 'file'}$/;" t class:_M.lua
extend _HOME/lexers/lexer.lua /^module('lexer')]=]$/;" F class:lexer
-extensions _HOME/modules/textadept/file_types.lua /^M.extensions = {--[[Actionscript]]as='actionscript',asc='actionscript',--[[Ada]]adb='ada',ads='ada',--[[ANTLR]]g='antlr',g4='antlr',--[[APDL]]ans='apdl',inp='apdl',mac='apdl',--[[APL]]apl='apl',--[[Applescript]]applescript='applescript',--[[ASM]]asm='asm',ASM='asm',s='asm',S='asm',--[[ASP]]asa='asp',asp='asp',hta='asp',--[[AutoIt]]au3='autoit',a3x='autoit',--[[AWK]]awk='awk',--[[Batch]]bat='batch',cmd='batch',--[[BibTeX]]bib='bibtex',--[[Boo]]boo='boo',--[[C#]]cs='csharp',--[[C/C++]]c='ansi_c',cc='cpp',C='ansi_c',cpp='cpp',cxx='cpp',['c++']='cpp',h='cpp',hh='cpp',hpp='cpp',hxx='cpp',['h++']='cpp',--[[ChucK]]ck='chuck',--[[CMake]]cmake='cmake',['cmake.in']='cmake',ctest='cmake',['ctest.in']='cmake',--[[CoffeeScript]]coffee='coffeescript',--[[Crystal]]cr='crystal',--[[CSS]]css='css',--[[CUDA]]cu='cuda',cuh='cuda',--[[D]]d='dmd',di='dmd',--[[Dart]]dart='dart',--[[Desktop]]desktop='desktop',--[[diff]]diff='diff',patch='diff',--[[Dockerfile]]Dockerfile='dockerfile',--[[dot]]dot='dot',--[[Eiffel]]e='eiffel',eif='eiffel',--[[Elixir]]ex='elixir',exs='elixir',--[[Erlang]]erl='erlang',hrl='erlang',--[[F#]]fs='fsharp',--[[Faust]]dsp='faust',--[[Fennel]]fnl='fennel',--[[Fish]]fish='fish',--[[Forth]]forth='forth',frt='forth',fs='forth',--[[Fortran]]f='fortran',['for']='fortran',ftn='fortran',fpp='fortran',f77='fortran',f90='fortran',f95='fortran',f03='fortran',f08='fortran',--[[Gap]]g='gap',gd='gap',gi='gap',gap='gap',--[[Gettext]]po='gettext',pot='gettext',--[[Gherkin]]feature='gherkin',--[[GLSL]]glslf='glsl',glslv='glsl',--[[GNUPlot]]dem='gnuplot',plt='gnuplot',--[[Go]]go='go',--[[Groovy]]groovy='groovy',gvy='groovy',--[[Gtkrc]]gtkrc='gtkrc',--[[Haskell]]hs='haskell',--[[HTML]]htm='html',html='html',shtm='html',shtml='html',xhtml='html',vue='html',--[[Icon]]icn='icon',--[[IDL]]idl='idl',odl='idl',--[[Inform]]inf='inform',ni='inform',--[[ini]]cfg='ini',cnf='ini',inf='ini',ini='ini',reg='ini',--[[Io]]io='io_lang',--[[Java]]bsh='java',java='java',--[[Javascript]]js='javascript',jsfl='javascript',--[[jq]]jq='jq',--[[JSON]]json='json',--[[JSP]]jsp='jsp',--[[LaTeX]]bbl='latex',dtx='latex',ins='latex',ltx='latex',tex='latex',sty='latex',--[[Ledger]]ledger='ledger',journal='ledger',--[[LESS]]less='less',--[[LilyPond]]lily='lilypond',ly='lilypond',--[[Lisp]]cl='lisp',el='lisp',lisp='lisp',lsp='lisp',--[[Literate Coffeescript]]litcoffee='litcoffee',--[[Logtalk]]lgt='logtalk',--[[Lua]]lua='lua',--[[Makefile]]GNUmakefile='makefile',iface='makefile',mak='makefile',makefile='makefile',Makefile='makefile',--[[Man]]['1']='man',['2']='man',['3']='man',['4']='man',['5']='man',['6']='man',['7']='man',['8']='man',['9']='man',['1x']='man',['2x']='man',['3x']='man',['4x']='man',['5x']='man',['6x']='man',['7x']='man',['8x']='man',['9x']='man',--[[Markdown]]md='markdown',--[[MoonScript]]moon='moonscript',--[[Myrddin]]myr='myrddin',--[[Nemerle]]n='nemerle',--[[Nim]]nim='nim',--[[NSIS]]nsh='nsis',nsi='nsis',nsis='nsis',--[[Objective C]]m='objective_c',mm='objective_c',objc='objective_c',--[[OCaml]]caml='caml',ml='caml',mli='caml',mll='caml',mly='caml',--[[Pascal]]dpk='pascal',dpr='pascal',p='pascal',pas='pascal',--[[Perl]]al='perl',perl='perl',pl='perl',pm='perl',pod='perl',--[[PHP]]inc='php',php='php',php3='php',php4='php',phtml='php',--[[PICO-8]]p8='pico',--[[Pike]]pike='pike',pmod='pike',--[[PKGBUILD]]PKGBUILD='pkgbuild',--[[Postscript]]eps='ps',ps='ps',--[[PowerShell]]ps1='powershell',--[[Prolog]]prolog='prolog',--[[Properties]]props='props',properties='props',--[[Protobuf]]proto='protobuf',--[[Pure]]pure='pure',--[[Python]]sc='python',py='python',pyw='python',--[[R]]R='rstats',Rout='rstats',Rhistory='rstats',Rt='rstats',['Rout.save']='rstats',['Rout.fail']='rstats',S='rstats',--[[REBOL]]r='rebol',reb='rebol',--[[reST]]rst='rest',--[[Rexx]]orx='rexx',rex='rexx',--[[RHTML]]erb='rhtml',rhtml='rhtml',--[[Ruby]]Rakefile='ruby',rake='ruby',rb='ruby',rbw='ruby',--[[Rust]]rs='rust',--[[Sass CSS]]sass='sass',scss='sass',--[[Scala]]scala='scala',--[[Scheme]]sch='scheme',scm='scheme',--[[Shell]]bash='bash',bashrc='bash',bash_profile='bash',configure='bash',csh='bash',ksh='bash',mksh='bash',sh='bash',zsh='bash',--[[Smalltalk]]changes='smalltalk',st='smalltalk',sources='smalltalk',--[[SML]]sml='sml',fun='sml',sig='sml',--[[SNOBOL4]]sno='snobol4',SNO='snobol4',--[[SQL]]ddl='sql',sql='sql',--[[TaskPaper]]taskpaper='taskpaper',--[[Tcl]]tcl='tcl',tk='tcl',--[[Texinfo]]texi='texinfo',--[[TOML]]toml='toml',--[[Txt2tags]]t2t='txt2tags',--[[Vala]]vala='vala',--[[vCard]]vcf='vcard',vcard='vcard',--[[Verilog]]v='verilog',ver='verilog',--[[VHDL]]vh='vhdl',vhd='vhdl',vhdl='vhdl',--[[Visual Basic]]asa='vb',bas='vb',cls='vb',ctl='vb',dob='vb',dsm='vb',dsr='vb',frm='vb',pag='vb',vb='vb',vba='vb',vbs='vb',--[[WSF]]wsf='wsf',--[[XML]]dtd='xml',svg='xml',xml='xml',xsd='xml',xsl='xml',xslt='xml',xul='xml',--[[Xtend]]xtend='xtend',--[[YAML]]yaml='yaml',yml='yaml'}$/;" t class:textadept.file_types
+extensions _HOME/modules/textadept/file_types.lua /^M.extensions = {--[[Actionscript]]as='actionscript',asc='actionscript',--[[Ada]]adb='ada',ads='ada',--[[ANTLR]]g='antlr',g4='antlr',--[[APDL]]ans='apdl',inp='apdl',mac='apdl',--[[APL]]apl='apl',--[[Applescript]]applescript='applescript',--[[ASM]]asm='asm',ASM='asm',s='asm',S='asm',--[[ASP]]asa='asp',asp='asp',hta='asp',--[[AutoIt]]au3='autoit',a3x='autoit',--[[AWK]]awk='awk',--[[Batch]]bat='batch',cmd='batch',--[[BibTeX]]bib='bibtex',--[[Boo]]boo='boo',--[[C#]]cs='csharp',--[[C/C++]]c='ansi_c',cc='cpp',C='ansi_c',cpp='cpp',cxx='cpp',['c++']='cpp',h='cpp',hh='cpp',hpp='cpp',hxx='cpp',['h++']='cpp',--[[ChucK]]ck='chuck',--[[Clojure]]clj='clojure',cljs='clojure',cljc='clojure',edn='clojure',--[[CMake]]cmake='cmake',['cmake.in']='cmake',ctest='cmake',['ctest.in']='cmake',--[[CoffeeScript]]coffee='coffeescript',--[[Crystal]]cr='crystal',--[[CSS]]css='css',--[[CUDA]]cu='cuda',cuh='cuda',--[[D]]d='dmd',di='dmd',--[[Dart]]dart='dart',--[[Desktop]]desktop='desktop',--[[diff]]diff='diff',patch='diff',--[[Dockerfile]]Dockerfile='dockerfile',--[[dot]]dot='dot',--[[Eiffel]]e='eiffel',eif='eiffel',--[[Elixir]]ex='elixir',exs='elixir',--[[Elm]]elm='elm',--[[Erlang]]erl='erlang',hrl='erlang',--[[F#]]fs='fsharp',--[[Fantom]]fan='fantom',--[[Faust]]dsp='faust',--[[Fennel]]fnl='fennel',--[[Fish]]fish='fish',--[[Forth]]forth='forth',frt='forth',--[[Fortran]]f='fortran',['for']='fortran',ftn='fortran',fpp='fortran',f77='fortran',f90='fortran',f95='fortran',f03='fortran',f08='fortran',--[[fstab]]fstab='fstab',--[[Gap]]g='gap',gd='gap',gi='gap',gap='gap',--[[Gettext]]po='gettext',pot='gettext',--[[Gherkin]]feature='gherkin',--[[GLSL]]glslf='glsl',glslv='glsl',--[[GNUPlot]]dem='gnuplot',plt='gnuplot',--[[Go]]go='go',--[[Groovy]]groovy='groovy',gvy='groovy',--[[Gtkrc]]gtkrc='gtkrc',--[[Haskell]]hs='haskell',--[[HTML]]htm='html',html='html',shtm='html',shtml='html',xhtml='html',vue='html',--[[Icon]]icn='icon',--[[IDL]]idl='idl',odl='idl',--[[Inform]]inf='inform',ni='inform',--[[ini]]cfg='ini',cnf='ini',inf='ini',ini='ini',reg='ini',--[[Io]]io='io_lang',--[[Java]]bsh='java',java='java',--[[Javascript]]js='javascript',jsfl='javascript',--[[jq]]jq='jq',--[[JSON]]json='json',--[[JSP]]jsp='jsp',--[[Julia]]jl='julia',--[[LaTeX]]bbl='latex',dtx='latex',ins='latex',ltx='latex',tex='latex',sty='latex',--[[Ledger]]ledger='ledger',journal='ledger',--[[LESS]]less='less',--[[LilyPond]]lily='lilypond',ly='lilypond',--[[Lisp]]cl='lisp',el='lisp',lisp='lisp',lsp='lisp',--[[Literate Coffeescript]]litcoffee='litcoffee',--[[Logtalk]]lgt='logtalk',--[[Lua]]lua='lua',--[[Makefile]]GNUmakefile='makefile',iface='makefile',mak='makefile',makefile='makefile',Makefile='makefile',--[[Man]]['1']='man',['2']='man',['3']='man',['4']='man',['5']='man',['6']='man',['7']='man',['8']='man',['9']='man',['1x']='man',['2x']='man',['3x']='man',['4x']='man',['5x']='man',['6x']='man',['7x']='man',['8x']='man',['9x']='man',--[[Markdown]]md='markdown',--[[Meson]]['meson.build']='meson',--[[MoonScript]]moon='moonscript',--[[Myrddin]]myr='myrddin',--[[Nemerle]]n='nemerle',--[[Networkd]]link='networkd',network='networkd',netdev='networkd',--[[Nim]]nim='nim',--[[NSIS]]nsh='nsis',nsi='nsis',nsis='nsis',--[[Objective C]]m='objective_c',mm='objective_c',objc='objective_c',--[[OCaml]]caml='caml',ml='caml',mli='caml',mll='caml',mly='caml',--[[Pascal]]dpk='pascal',dpr='pascal',p='pascal',pas='pascal',--[[Perl]]al='perl',perl='perl',pl='perl',pm='perl',pod='perl',--[[PHP]]inc='php',php='php',php3='php',php4='php',phtml='php',--[[PICO-8]]p8='pico8',--[[Pike]]pike='pike',pmod='pike',--[[PKGBUILD]]PKGBUILD='pkgbuild',--[[Pony]]pony='pony',--[[Postscript]]eps='ps',ps='ps',--[[PowerShell]]ps1='powershell',--[[Prolog]]prolog='prolog',--[[Properties]]props='props',properties='props',--[[Protobuf]]proto='protobuf',--[[Pure]]pure='pure',--[[Python]]sc='python',py='python',pyw='python',--[[R]]R='rstats',Rout='rstats',Rhistory='rstats',Rt='rstats',['Rout.save']='rstats',['Rout.fail']='rstats',S='rstats',--[[Reason]]re='reason',--[[REBOL]]r='rebol',reb='rebol',--[[reST]]rst='rest',--[[Rexx]]orx='rexx',rex='rexx',--[[RHTML]]erb='rhtml',rhtml='rhtml',--[[RouterOS]]rsc='routeros',--[[Ruby]]Rakefile='ruby',rake='ruby',rb='ruby',rbw='ruby',--[[Rust]]rs='rust',--[[Sass CSS]]sass='sass',scss='sass',--[[Scala]]scala='scala',--[[Scheme]]sch='scheme',scm='scheme',--[[Shell]]bash='bash',bashrc='bash',bash_profile='bash',configure='bash',csh='bash',ksh='bash',mksh='bash',sh='bash',zsh='bash',--[[Smalltalk]]changes='smalltalk',st='smalltalk',sources='smalltalk',--[[SML]]sml='sml',fun='sml',sig='sml',--[[SNOBOL4]]sno='snobol4',SNO='snobol4',--[[Spin]]spin='spin',--[[SQL]]ddl='sql',sql='sql',--[[Systemd]]automount='systemd',device='systemd',mount='systemd',path='systemd',scope='systemd',service='systemd',slice='systemd',socket='systemd',swap='systemd',target='systemd',timer='systemd',--[[TaskPaper]]taskpaper='taskpaper',--[[Tcl]]tcl='tcl',tk='tcl',--[[Texinfo]]texi='texinfo',--[[TOML]]toml='toml',--[[Txt2tags]]t2t='txt2tags',--[[Vala]]vala='vala',--[[vCard]]vcf='vcard',vcard='vcard',--[[Verilog]]v='verilog',ver='verilog',--[[VHDL]]vh='vhdl',vhd='vhdl',vhdl='vhdl',--[[Visual Basic]]asa='vb',bas='vb',cls='vb',ctl='vb',dob='vb',dsm='vb',dsr='vb',frm='vb',pag='vb',vb='vb',vba='vb',vbs='vb',--[[WSF]]wsf='wsf',--[[XML]]dtd='xml',svg='xml',xml='xml',xsd='xml',xsl='xml',xslt='xml',xul='xml',--[[Xs]]xs='xs',xsin='xs',xsrc='xs',--[[Xtend]]xtend='xtend',--[[YAML]]yaml='yaml',yml='yaml',--[[Zig]]zig='zig'}$/;" t class:textadept.file_types
extra_ascent _HOME/core/.view.luadoc /^module('view')$/;" F class:view
extra_descent _HOME/core/.view.luadoc /^module('view')$/;" F class:view
file_types _HOME/modules/textadept/file_types.lua /^module('textadept.file_types')]]$/;" m class:textadept
@@ -809,7 +809,7 @@ rotate_selection _HOME/core/.buffer.luadoc /^function rotate_selection(buffer) e
run _HOME/modules/textadept/command_entry.lua /^function M.run(f, keys, lang, height)$/;" f class:ui.command_entry
run _HOME/modules/textadept/run.lua /^function M.run(filename)$/;" f class:textadept.run
run _HOME/modules/textadept/run.lua /^module('textadept.run')]]$/;" m class:textadept
-run_commands _HOME/modules/textadept/run.lua /^M.run_commands = {actionscript=WIN32 and 'start "" "%e.swf"' or OSX and 'open "file://%e.swf"' or 'xdg-open "%e.swf"',ada=WIN32 and '"%e"' or './"%e"',ansi_c=WIN32 and '"%e"' or './"%e"',applescript='osascript "%f"',asm='./"%e"',awk='awk -f "%f"',batch='"%f"',boo='booi "%f"',caml='ocamlrun "%e"',csharp=WIN32 and '"%e"' or 'mono "%e.exe"',chuck='chuck "%f"',cmake='cmake -P "%f"',coffeescript='coffee "%f"',context=WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',cpp=WIN32 and '"%e"' or './"%e"',crystal='crystal "%f"',cuda=WIN32 and '"%e"' or './"%e"',dart='dart "%f"',dmd=WIN32 and '"%e"' or './"%e"',eiffel="./a.out",elixir='elixir "%f"',fsharp=WIN32 and '"%e"' or 'mono "%e.exe"',fennel='fennel "%f"',forth='gforth "%f" -e bye',fortran=WIN32 and '"%e"' or './"%e"',gnuplot='gnuplot "%f"',go='go run "%f"',groovy='groovy "%f"',haskell=WIN32 and '"%e"' or './"%e"',html=WIN32 and 'start "" "%f"' or OSX and 'open "file://%f"' or 'xdg-open "%f"',icon='icont "%e" -x',idl='idl -batch "%f"',Io='io "%f"',java='java "%e"',javascript='node "%f"',jq='jq -f "%f"',ltx=WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',less='lessc --no-color "%f"',lilypond=WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',lisp='clisp "%f"',litcoffee='coffee "%f"',lua='lua -e "io.stdout:setvbuf(\'no\')" "%f"',makefile=WIN32 and 'nmake -f "%f"' or 'make -f "%f"',markdown='markdown "%f"',moon='moon "%f"',myr=WIN32 and '"%e"' or './"%e"',nemerle=WIN32 and '"%e"' or 'mono "%e.exe"',nim='nim c -r "%f"',objective_c=WIN32 and '"%e"' or './"%e"',pascal=WIN32 and '"%e"' or './"%e"',perl='perl "%f"',php='php "%f"',pike='pike "%f"',pkgbuild='makepkg -p "%f"',prolog=WIN32 and '"%e"' or './"%e"',pure='pure "%f"',python=function() return buffer:get_line(1):find('^#!.-python3') and 'python3 -u "%f"' or 'python -u "%f"' end,rstats=WIN32 and 'Rterm -f "%f"' or 'R -f "%f"',rebol='REBOL "%f"',rexx=WIN32 and 'rexx "%f"' or 'regina "%f"',ruby='ruby "%f"',rust=WIN32 and '"%e"' or './"%e"',sass='sass "%f"',scala='scala "%e"',bash='bash "%f"',csh='tcsh "%f"',ksh='ksh "%f"',mksh='mksh "%f"',sh='sh "%f"',zsh='zsh "%f"',rc='rc "%f"',smalltalk='gst "%f"',sml=WIN32 and '"%e"' or './"%e"',snobol4='snobol4 -b "%f"',tcl='tclsh "%f"',tex=WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',vala=WIN32 and '"%e"' or './"%e"',vb=WIN32 and '"%e"' or 'mono "%e.exe"',}$/;" t class:textadept.run
+run_commands _HOME/modules/textadept/run.lua /^M.run_commands = {actionscript=WIN32 and 'start "" "%e.swf"' or OSX and 'open "file://%e.swf"' or 'xdg-open "%e.swf"',ada=WIN32 and '"%e"' or './"%e"',ansi_c=WIN32 and '"%e"' or './"%e"',applescript='osascript "%f"',asm='./"%e"',awk='awk -f "%f"',batch='"%f"',boo='booi "%f"',caml='ocamlrun "%e"',csharp=WIN32 and '"%e"' or 'mono "%e.exe"',chuck='chuck "%f"',clojure='clj -M "%f"',cmake='cmake -P "%f"',coffeescript='coffee "%f"',context=WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',cpp=WIN32 and '"%e"' or './"%e"',crystal='crystal "%f"',cuda=WIN32 and '"%e"' or './"%e"',dart='dart "%f"',dmd=WIN32 and '"%e"' or './"%e"',eiffel="./a.out",elixir='elixir "%f"',fsharp=WIN32 and '"%e"' or 'mono "%e.exe"',fantom='fan "%f"',fennel='fennel "%f"',forth='gforth "%f" -e bye',fortran=WIN32 and '"%e"' or './"%e"',gnuplot='gnuplot "%f"',go='go run "%f"',groovy='groovy "%f"',haskell=WIN32 and '"%e"' or './"%e"',html=WIN32 and 'start "" "%f"' or OSX and 'open "file://%f"' or 'xdg-open "%f"',icon='icont "%e" -x',idl='idl -batch "%f"',Io='io "%f"',java='java "%e"',javascript='node "%f"',jq='jq -f "%f"',julia='julia "%f"',ltx=WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',less='lessc --no-color "%f"',lilypond=WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',lisp='clisp "%f"',litcoffee='coffee "%f"',lua='lua -e "io.stdout:setvbuf(\'no\')" "%f"',makefile=WIN32 and 'nmake -f "%f"' or 'make -f "%f"',markdown='markdown "%f"',moon='moon "%f"',myr=WIN32 and '"%e"' or './"%e"',nemerle=WIN32 and '"%e"' or 'mono "%e.exe"',nim='nim c -r "%f"',objective_c=WIN32 and '"%e"' or './"%e"',pascal=WIN32 and '"%e"' or './"%e"',perl='perl "%f"',php='php "%f"',pike='pike "%f"',pkgbuild='makepkg -p "%f"',pony=WIN32 and '"%e"' or './"%e"',prolog=WIN32 and '"%e"' or './"%e"',pure='pure "%f"',python=function() return buffer:get_line(1):find('^#!.-python3') and 'python3 -u "%f"' or 'python -u "%f"' end,rstats=WIN32 and 'Rterm -f "%f"' or 'R -f "%f"',rebol='REBOL "%f"',rexx=WIN32 and 'rexx "%f"' or 'regina "%f"',ruby='ruby "%f"',rust=WIN32 and '"%e"' or './"%e"',sass='sass "%f"',scala='scala "%e"',bash='bash "%f"',csh='tcsh "%f"',ksh='ksh "%f"',mksh='mksh "%f"',sh='sh "%f"',zsh='zsh "%f"',rc='rc "%f"',smalltalk='gst "%f"',sml=WIN32 and '"%e"' or './"%e"',snobol4='snobol4 -b "%f"',tcl='tclsh "%f"',tex=WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',vala=WIN32 and '"%e"' or './"%e"',vb=WIN32 and '"%e"' or 'mono "%e.exe"',xs='xs "%f"',zig=WIN32 and '"%e"' or './"%e"'}$/;" t class:textadept.run
run_in_background _HOME/modules/textadept/run.lua /^module('textadept.run')]]$/;" F class:textadept.run
save _HOME/core/.buffer.luadoc /^function save(buffer) end$/;" f class:buffer
save _HOME/modules/textadept/macros.lua /^function M.save(filename)$/;" f class:textadept.macros
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index cffb78aa..ba7526cf 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -153,8 +153,8 @@ end
-- Runs command *command* in working directory *dir*, emitting events of type
-- *event* with any output received.
-- @param command String command to run, or a function returning such a string
--- and optional working directory. A returned working directory overrides
--- *dir*.
+-- and optional working directory and environment table. A returned working
+-- directory overrides *dir*.
-- @param dir String working directory to run *command* in.
-- @param event String event name to emit command output with.
-- @param macros Optional table of '%[char]' macros to expand within *command*.
@@ -162,8 +162,8 @@ end
-- executed command. This is used for better error detection in compile and
-- run commands.
local function run_command(command, dir, event, macros, ext_or_lexer)
- local working_dir
- if type(command) == 'function' then command, working_dir = command() end
+ local working_dir, env
+ if type(command) == 'function' then command, working_dir, env = command() end
if not command then return end
if macros then command = command:gsub('%%%a', macros) end
preferred_view = view
@@ -171,10 +171,12 @@ local function run_command(command, dir, event, macros, ext_or_lexer)
cwd = (working_dir or dir):gsub('[/\\]$', '')
events.emit(event, string.format('> cd %s\n', cwd))
events.emit(event, string.format('> %s\n', command:iconv('UTF-8', _CHARSET)))
- proc = assert(os.spawn(command, cwd, emit, emit, function(status)
+ local args = {command, cwd, emit, emit, function(status)
emit() -- flush
events.emit(event, string.format('> exit status: %d\n', status))
- end))
+ end}
+ if env then table.insert(args, 3, env) end
+ proc = assert(os.spawn(table.unpack(args)))
end
-- Compiles or runs file *filename* based on a shell command in *commands*.
@@ -212,8 +214,9 @@ end
-- + `%d`: The file's directory path.
-- + `%p`: The file's full path.
--
--- Functions may also return a working directory to operate in. By default, it
--- is the current file's parent directory.
+-- Functions may also return a working directory and process environment table
+-- to operate in. By default, the working directory is the current file's parent
+-- directory and the environment is Textadept's environment.
-- @class table
-- @name compile_commands
M.compile_commands = {actionscript='mxmlc "%f"',ada='gnatmake "%f"',ansi_c='gcc -o "%e" "%f"',antlr='antlr4 "%f"',g='antlr3 "%f"',applescript='osacompile "%f" -o "%e.scpt"',asm='nasm "%f"'--[[ && ld "%e.o" -o "%e"']],boo='booc "%f"',caml='ocamlc -o "%e" "%f"',csharp=WIN32 and 'csc "%f"' or 'mcs "%f"',coffeescript='coffee -c "%f"',context='context --nonstopmode "%f"',cpp='g++ -o "%e" "%f"',cuda=WIN32 and 'nvcc -o "%e.exe" "%f"' or 'nvcc -o "%e" "%f"',dmd='dmd "%f"',dot='dot -Tps "%f" -o "%e.ps"',eiffel='se c "%f"',elixir='elixirc "%f"',erlang='erl -compile "%e"',faust='faust -o "%e.cpp" "%f"',fsharp=WIN32 and 'fsc.exe "%f"' or 'mono fsc.exe "%f"',fortran='gfortran -o "%e" "%f"',gap='gac -o "%e" "%f"',go='go build "%f"',groovy='groovyc "%f"',haskell=WIN32 and 'ghc -o "%e.exe" "%f"' or 'ghc -o "%e" "%f"',inform=function() return 'inform -c "'..buffer.filename:match('^(.+%.inform[/\\])Source')..'"' end,java='javac "%f"',ltx='pdflatex -file-line-error -halt-on-error "%f"',less='lessc --no-color "%f" "%e.css"',lilypond='lilypond "%f"',lisp='clisp -c "%f"',litcoffee='coffee -c "%f"',lua='luac -o "%e.luac" "%f"',moon='moonc "%f"',markdown='markdown "%f" > "%e.html"',myr='mbld -b "%e" "%f"',nemerle='ncc "%f" -out:"%e.exe"',nim='nim c "%f"',nsis='MakeNSIS "%f"',objective_c='gcc -o "%e" "%f"',pascal='fpc "%f"',perl='perl -c "%f"',php='php -l "%f"',pony='ponyc "%f"',prolog='gplc --no-top-level "%f"',python='python -m py_compile "%f"',ruby='ruby -c "%f"',rust='rustc "%f"',sass='sass "%f" "%e.css"',scala='scalac "%f"',sml='mlton "%f"',tex='pdflatex -file-line-error -halt-on-error "%f"',vala='valac "%f"',vb=WIN32 and 'vbc "%f"' or 'vbnc "%f"',zig='zig build-exe "%f"'}
@@ -246,8 +249,9 @@ events.connect(events.COMPILE_OUTPUT, print_output)
-- + `%d`: The file's directory path.
-- + `%p`: The file's full path.
--
--- Functions may also return a working directory to operate in. By default, it
--- is the current file's parent directory.
+-- Functions may also return a working directory and process environment table
+-- to operate in. By default, the working directory is the current file's parent
+-- directory and the environment is Textadept's environment.
-- @class table
-- @name run_commands
M.run_commands = {actionscript=WIN32 and 'start "" "%e.swf"' or OSX and 'open "file://%e.swf"' or 'xdg-open "%e.swf"',ada=WIN32 and '"%e"' or './"%e"',ansi_c=WIN32 and '"%e"' or './"%e"',applescript='osascript "%f"',asm='./"%e"',awk='awk -f "%f"',batch='"%f"',boo='booi "%f"',caml='ocamlrun "%e"',csharp=WIN32 and '"%e"' or 'mono "%e.exe"',chuck='chuck "%f"',clojure='clj -M "%f"',cmake='cmake -P "%f"',coffeescript='coffee "%f"',context=WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',cpp=WIN32 and '"%e"' or './"%e"',crystal='crystal "%f"',cuda=WIN32 and '"%e"' or './"%e"',dart='dart "%f"',dmd=WIN32 and '"%e"' or './"%e"',eiffel="./a.out",elixir='elixir "%f"',fsharp=WIN32 and '"%e"' or 'mono "%e.exe"',fantom='fan "%f"',fennel='fennel "%f"',forth='gforth "%f" -e bye',fortran=WIN32 and '"%e"' or './"%e"',gnuplot='gnuplot "%f"',go='go run "%f"',groovy='groovy "%f"',haskell=WIN32 and '"%e"' or './"%e"',html=WIN32 and 'start "" "%f"' or OSX and 'open "file://%f"' or 'xdg-open "%f"',icon='icont "%e" -x',idl='idl -batch "%f"',Io='io "%f"',java='java "%e"',javascript='node "%f"',jq='jq -f "%f"',julia='julia "%f"',ltx=WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',less='lessc --no-color "%f"',lilypond=WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',lisp='clisp "%f"',litcoffee='coffee "%f"',lua='lua -e "io.stdout:setvbuf(\'no\')" "%f"',makefile=WIN32 and 'nmake -f "%f"' or 'make -f "%f"',markdown='markdown "%f"',moon='moon "%f"',myr=WIN32 and '"%e"' or './"%e"',nemerle=WIN32 and '"%e"' or 'mono "%e.exe"',nim='nim c -r "%f"',objective_c=WIN32 and '"%e"' or './"%e"',pascal=WIN32 and '"%e"' or './"%e"',perl='perl "%f"',php='php "%f"',pike='pike "%f"',pkgbuild='makepkg -p "%f"',pony=WIN32 and '"%e"' or './"%e"',prolog=WIN32 and '"%e"' or './"%e"',pure='pure "%f"',python=function() return buffer:get_line(1):find('^#!.-python3') and 'python3 -u "%f"' or 'python -u "%f"' end,rstats=WIN32 and 'Rterm -f "%f"' or 'R -f "%f"',rebol='REBOL "%f"',rexx=WIN32 and 'rexx "%f"' or 'regina "%f"',ruby='ruby "%f"',rust=WIN32 and '"%e"' or './"%e"',sass='sass "%f"',scala='scala "%e"',bash='bash "%f"',csh='tcsh "%f"',ksh='ksh "%f"',mksh='mksh "%f"',sh='sh "%f"',zsh='zsh "%f"',rc='rc "%f"',smalltalk='gst "%f"',sml=WIN32 and '"%e"' or './"%e"',snobol4='snobol4 -b "%f"',tcl='tclsh "%f"',tex=WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',vala=WIN32 and '"%e"' or './"%e"',vb=WIN32 and '"%e"' or 'mono "%e.exe"',xs='xs "%f"',zig=WIN32 and '"%e"' or './"%e"'}
@@ -321,8 +325,9 @@ end
---
-- Map of project root paths and "makefiles" to their associated "build" shell
-- command line strings or functions that return such strings.
--- Functions may also return a working directory to operate in. By default, it
--- is the project's root directory.
+-- Functions may also return a working directory and process environment table
+-- to operate in. By default, the working directory is the project's root
+-- directory and the environment is Textadept's environment.
-- @class table
-- @name build_commands
M.build_commands = {--[[Ant]]['build.xml']='ant',--[[Dockerfile]]Dockerfile='docker build .',--[[Make]]Makefile='make',GNUmakefile='make',makefile='make',--[[Meson]]['meson.build']='meson compile',--[[Maven]]['pom.xml']='mvn',--[[Ruby]]Rakefile='rake'}
diff --git a/test/test.lua b/test/test.lua
index 25aff22a..5a0fae05 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -3130,6 +3130,25 @@ function test_run_goto_internal_lua_error()
buffer:close()
end
+function test_run_commands_function()
+ local filename = os.tmpname()
+ io.open_file(filename)
+ textadept.run.run_commands.text = function()
+ return [[lua -e 'print(os.getenv("FOO"))']], '/tmp', {FOO = 'bar'}
+ end
+ textadept.run.run()
+ assert_equal(#_BUFFERS, 3) -- including [Test Output]
+ assert_equal(buffer._type, _L['[Message Buffer]'])
+ ui.update() -- process output
+ assert(buffer:get_text():find('> cd /tmp'), 'cwd not set properly')
+ assert(buffer:get_text():find('bar'), 'env not set properly')
+ if #_VIEWS > 1 then view:unsplit() end
+ buffer:close()
+ buffer:close()
+ textadept.run.run_commands.text = nil -- reset
+ os.remove(filename)
+end
+
-- TODO: test textadept.run.run_in_background
function test_session_save()