diff options
Diffstat (limited to 'core/.textadept.lua')
-rw-r--r-- | core/.textadept.lua | 57 |
1 files changed, 43 insertions, 14 deletions
diff --git a/core/.textadept.lua b/core/.textadept.lua index e2da427f..9e0375a7 100644 --- a/core/.textadept.lua +++ b/core/.textadept.lua @@ -19,9 +19,11 @@ module('textadept') -- @field statusbar_text The text displayed by the statusbar (write-only). -- @field docstatusbar_text The text displayed by the doc statusbar -- (write-only). --- @field size The size of the Textadept window. -textadept = { title = nil, focused_doc_pointer = nil, clipboard_text = nil, - menubar = nil, statusbar_text = nil, docstatusbar_text = nil, size = nil } +-- @field size The size of the Textadept window ({ width, height}). +textadept = { + title = nil, focused_doc_pointer = nil, clipboard_text = nil, menubar = nil, + statusbar_text = nil, docstatusbar_text = nil, size = nil +} --- -- A numerically indexed table of open buffers in Textadept. @@ -77,6 +79,20 @@ function gtkmenu(menu_table) end function popupmenu(menu) 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 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. +function reset() end + +--- Quits Textadept. +function quit() end + +--- -- 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 @@ -85,16 +101,29 @@ function popupmenu(menu) end function check_focused_buffer(buffer) end --- --- Prints a message to the error buffer. -function print(...) end +-- Helper function for printing messages to buffers. +-- Splits the view and opens a new buffer for printing messages. If the message +-- buffer is already open and a view is currently showing it, the message is +-- printed to that view. Otherwise the view is split, goes to the open message +-- buffer, and prints to it. +-- @param buffer_type String type of message buffer. +-- @param ... Message strings. +-- @usage textadept._print('shows_errors', error_message) +-- @usage textadept._print('shows_messages', message) +function _print(buffer_type, ...) --- --- 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 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. -function reset() end +-- Prints messages to the Textadept message buffer. +-- Opens a new buffer (if one hasn't already been opened) for printing messages. +-- @param ... Message strings. +function textadept.print(...) end + +--- +-- Displays a CocoaDialog of a specified type with given arguments returning +-- the result. +-- @param kind The CocoaDialog type. +-- @param opts A table of key, value arguments. Each key is a --key switch with +-- a "value" value. If value is nil, it is omitted and just the switch is +-- used. +-- @return string CocoaDialog result. +function cocoa_dialog(kind, opts) |