Module textadept
The core textadept table. [Dummy file]
Functions
| check_focused_buffer (buffer) |
Checks if the buffer being indexed is the currently focused buffer. |
| get_split_table () |
Gets the current split view structure. |
| goto_view (n, absolute) |
Goes to the specified view. |
| gtkmenu (menu_table) |
Creates a GTK menu, returning the userdata. |
| new_buffer () |
Creates a new buffer. |
| popupmenu (menu) |
Pops up a GTK menu at the cursor. |
| print (...) |
Prints a message to the error buffer. |
| reset () |
Resets the Lua state by reloading all init scripts. |
Tables
| buffers |
A numerically indexed table of open buffers in Textadept. |
| textadept |
The core textadept table. |
| views |
A numerically indexed table of views in Textadept. |
Functions
- check_focused_buffer (buffer)
-
Checks if the buffer being indexed is the currently focused buffer. This is necessary because any buffer actions are performed in the focused views' buffer, which may not be the buffer being indexed. Throws an error if the check fails.
Parameters
-
buffer: The buffer in question.
- get_split_table ()
-
Gets the current split view structure.
Return value:
table of split views. Each split view entry is a table with 4 fields: 1, 2, vertical, and size. 1 and 2 have values of either split view entries or the index of the buffer shown in each view. vertical is a flag indicating if the split is vertical or not, and size is the integer position of the split resizer.
- goto_view (n, absolute)
-
Goes to the specified view. Activates the 'view_switch' signal.
Parameters
-
n: A relative or absolute view index.
-
absolute: Flag indicating if n is an absolute index or not.
- gtkmenu (menu_table)
-
Creates a GTK menu, returning the userdata.
Parameters
-
menu_table: A table defining the menu. It is an ordered list of strings that are handled as follows: 'gtk-*' - a stock menu item is created based on the GTK stock-id. 'separator' - a menu separator item is created. Otherwise a regular menu item with a mnemonic is created. An additional 'title' key can be used to define the menu's title text (if it is a submenu).
See also:
popupmenu
- new_buffer ()
-
Creates a new buffer. Activates the 'buffer_new' signal.
Return value:
the new buffer.
- popupmenu (menu)
-
Pops up a GTK menu at the cursor.
Parameters
-
menu: The menu userdata returned by gtkmenu.
See also:
gtkmenu
- print (...)
-
Prints a message to the error buffer.
Parameters
- reset ()
-
Resets the Lua state by reloading all init scripts. This is useful for modifying init scripts (such as key_commands.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.
Tables
- buffers
- A numerically indexed table of open buffers in Textadept.
- textadept
- The core textadept table.
Fields
-
title: The title of the Textadept window.
-
focused_doc_pointer: The pointer to the document associated with the buffer of the currently focused view. (Used internally; read-only)
-
menubar: A table of GTK menus defining a menubar (write-only).
-
clipboard_text: The text on the clipboard (read-only).
-
statusbar_text: The text displayed by the statusbar (write-only).
-
docstatusbar_text: The text displayed by the doc statusbar (write-only).
-
size: The size of the Textadept window.
- views
- A numerically indexed table of views in Textadept.