Contents

_G

Extends Lua’s _G table to provide extra functions and fields.


Fields


OSX (bool)

If Textadept is running on Mac OSX, this flag is true.


RESETTING (bool)

If reset() has been called, this flag is true while the Lua state is being re-initialized.


WIN32 (bool)

If Textadept is running on Windows, this flag is true.


_CHARSET (string)

The character set encoding of the filesystem. This is used in File I/O.


_HOME (string)

Path to the directory containing Textadept.


_LEXERPATH (string)

Paths to lexers, formatted like package.path.


_RELEASE (string)

The Textadept release version.


_USERHOME (string)

Path to the user’s ~/.textadept/.


Functions


new_buffer ()

Creates a new buffer. Generates a BUFFER_NEW event.

Return:


quit ()

Quits Textadept.


reset ()

Resets the Lua state by reloading all init scripts. Language-specific modules for opened files are NOT reloaded. Re-opening the files that use them will reload those modules. This function is useful for modifying init scripts (such as the user’s modules/textadept/keys.lua) on the fly without having to restart Textadept. _G.RESETTING is set to true when re-initing the Lua State. Any scripts that need to differentiate between startup and reset can utilize this variable.

See also:


timeout (interval, f, …)

Calls a given function after an interval of time. To repeatedly call the function, return true inside the function. A nil or false return value stops repetition.

Parameters:


user_dofile (filename)

Calls dofile() on the given filename in the user’s Textadept directory. Errors are printed to the Textadept message buffer.

Parameters:

Return:

See also:


Tables


_BUFFERS

Table of all open buffers in Textadept. Numeric keys have buffer values and buffer keys have their associated numeric keys.

Usage:


_VIEWS

Table of all views in Textadept. Numeric keys have view values and view keys have their associated numeric keys.

Usage:


arg

Command line parameters.