aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/._G.luadoc
blob: a0c0fb03f1f6cd468865d05682fe5434856db213 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
-- Copyright 2007-2010 Mitchell mitchell<att>caladbolg.net. See LICENSE.
-- This is a DUMMY FILE used for making LuaDoc for built-in functions in the
-- _G table.

--- Extends Lua's _G table to provide extra functions and fields.
module('_G')

-- Markdown:
-- ## Fields
--
-- * `_HOME`: Path to the directory containing Textadept.
-- * `_LEXERPATH`: Paths to lexers, formatted like
--   [`package.path`][package_path].
-- * `_RELEASE`: The Textadept release version.
-- * `_THEME`: The [theme](../manual/8_Themes.lua) 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](../modules/io.html).
-- * `RESETTING`: If [`reset()`](../modules/_G.html#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`.
-- * `OSX`: If Textadept is running on Mac OSX, this flag is `true`.
--
-- [package_path]: http://www.lua.org/manual/5.1/manual.html#pdf-package.path

---
-- Command line parameters.
-- @class table
-- @name arg
arg = {}


---
-- A numerically indexed table of open buffers in Textadept.
-- @class table
-- @name _BUFFERS
_BUFFERS = {}

---
-- A numerically indexed table of views in Textadept.
-- @class table
-- @name _VIEWS
_VIEWS = {}

---
-- Creates a new buffer.
-- Activates the 'buffer_new' signal.
-- @return the new buffer.
function new_buffer() end

---
-- 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.
-- @param interval The interval in seconds to call the function after.
-- @param f The function to call.
-- @param ... Additional arguments to pass to f.
function timeout(interval, f, ...) end

---
-- 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.
function reset() end

--- Quits Textadept.
function quit() end

---
-- 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.
-- @param filename The name of the file (not path).
-- @return true if successful; false otherwise.
function user_dofile(filename) end