Textadept
- Home |
- Download |
- Lua API |
- Source |
- Language Modules |
- Stats |
- Wiki |
- Mailing List
Contents
_M.textadept.run
Module for running/executing source files.
Typically, language-specific modules populate the compile_command
,
run_command
, and error_detail
tables for a particular language’s file
extension.
Run Events
_G.events.COMPILE_OUTPUT
Called after a compile command is executed. When connecting to this event (typically from a language-specific module), connect with an index of1
and returntrue
if the event was handled and you want to override the default handler that prints the output to a new view. Arguments:lexer
: The lexer language.output
: The output from the command.
_G.events.RUN_OUTPUT
Called after a run command is executed. When connecting to this event (typically from a language-specific module), connect with an index of1
and returntrue
if the event was handled and you want to override the default handler that prints the output to a new view. Arguments:lexer
: The lexer language.output
: The output from the command.
Functions
compile
()
Compiles the file as specified by its extension in the compile_command
table.
See also:
execute
(command, lexer)
Executes the command line parameter and prints the output to Textadept.
Parameters:
command
: The command line string. It can have the following macros:%(filepath)
: The full path of the current file.%(filedir)
: The current file’s directory path.%(filename)
: The name of the file including extension.%(filename_noext)
: The name of the file excluding extension.
lexer
: The current lexer.
goto_error
(pos, line_num)
When the user double-clicks an error message, go to the line in the file the error occured at and display a calltip with the error message.
Parameters:
pos
: The position of the caret.line_num
: The line double-clicked.
See also:
run
()
Runs/executes the file as specified by its extension in the run_command
table.
See also:
Tables
compile_command
File extensions and their associated ‘compile’ actions. Each key is a file extension whose value is a either a command line string to execute or a function returning one. This table is typically populated by language-specific modules.
error_detail
A table of error string details. Each entry is a table with the following fields:
pattern
: The Lua pattern that matches a specific error string.filename
: The index of the Lua capture that contains the filename the error occured in.line
: The index of the Lua capture that contains the line number the error occured on.message
: [Optional] The index of the Lua capture that contains the error’s message. A call tip will be displayed if a message was captured.
When an error message is double-clicked, the user is taken to the point of error. This table is usually populated by language-specific modules.
run_command
File extensions and their associated ‘go’ actions. Each key is a file extension whose value is either a command line string to execute or a function returning one. This table is typically populated by language-specific modules.