Module _G

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

Fields

  • _HOME: Path to the directory containing Textadept.
  • _LEXERPATH: Paths to lexers, formatted like package.path.
  • _RELEASE: The Textadept release version.
  • _THEME: The theme file to use.
  • _USERHOME: Path to the user's ~/.textadept/.
  • _CHARSET: The character set encoding of the filesystem. This is used in File I/O.
  • RESETTING: If reset() has been called, this flag is true while the Lua state is being re-initialized.
  • WIN32: If Textadept is running on Windows, this flag is true.
  • MAC: If Textadept is running on Mac OSX, this flag is true.

Functions

new_buffer () Creates a new buffer.
quit () Quits Textadept.
reset () Resets the Lua state by reloading all init scripts.
user_dofile (filename) Calls 'dofile' on the given filename in the user's Textadept directory.

Tables

_BUFFERS A numerically indexed table of open buffers in Textadept.
_VIEWS A numerically indexed table of views in Textadept.
arg Command line parameters.


Functions

new_buffer ()
Creates a new buffer. Activates the 'buffer_new' signal.

Return value:

the new buffer.
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 keys.lua) on the fly without having to restart Textadept. A global RESETTING variable is set to true when re-initing the Lua State. Any scripts that need to differentiate between startup and reset can utilize this variable.
user_dofile (filename)
Calls 'dofile' on the given filename in the user's Textadept directory. This is typically used for loading user files like key commands or snippets. Errors are printed to the Textadept message buffer.

Parameters

  • filename: The name of the file (not path).

Return value:

true if successful; false otherwise.

Tables

_BUFFERS
A numerically indexed table of open buffers in Textadept.
_VIEWS
A numerically indexed table of views in Textadept.
arg
Command line parameters.

Valid XHTML 1.0!