diff options
-rw-r--r-- | core/.command_entry.lua | 2 | ||||
-rw-r--r-- | core/.find.lua | 13 | ||||
-rw-r--r-- | core/.pm.lua | 8 | ||||
-rw-r--r-- | core/.textadept.lua | 57 | ||||
-rw-r--r-- | core/.view.lua | 4 | ||||
-rw-r--r-- | core/events.lua | 2 |
6 files changed, 67 insertions, 19 deletions
diff --git a/core/.command_entry.lua b/core/.command_entry.lua index 7902b6d6..3d5e24fd 100644 --- a/core/.command_entry.lua +++ b/core/.command_entry.lua @@ -12,7 +12,7 @@ module('textadept.command_entry') -- @class table -- @name textadept.command_entry -- @field entry_text The text in the entry. -command_entry = {} +command_entry = { entry_text = nil } --- Focuses the command entry. function focus() end diff --git a/core/.find.lua b/core/.find.lua index b2789287..7d016cae 100644 --- a/core/.find.lua +++ b/core/.find.lua @@ -28,7 +28,18 @@ module('textadept.find') -- @name textadept.find -- @field find_entry_text The text in the find entry. -- @field replace_entry_text The text in the replace entry. -find = { find_entry_text = nil, replace_entry_text = nil } +-- @field match_case Flag indicating whether or not case-sensitive search is +-- performed. +-- @field whole_word Flag indicating whether or not only whole-word matches are +-- allowed in searches. +-- @field lua Flag indicating whether or not the text to find in a search is a +-- Lua pattern. +-- @field in_files Flag indicating whether or not to search for the text in a +-- list of files. +find = { + find_entry_text = nil, replace_entry_text = nil, + match_case = nil, whole_word = nil, lua = nil, in_files = nil +} --- Displays and focuses the find/replace dialog. function focus() end diff --git a/core/.pm.lua b/core/.pm.lua index 61ddecc0..bd82bac3 100644 --- a/core/.pm.lua +++ b/core/.pm.lua @@ -15,7 +15,7 @@ module('textadept.pm') -- @field width The width of the project manager. -- @field cursor The cursor in the project manager (string representation of -- current GtkTreePath). -pm = {} +pm = { entry_text = nil, width = nil, cursor = nil } --- Focuses the project manager entry. function focus() end @@ -25,3 +25,9 @@ function clear() end --- Requests the project manager to get its contents based on its entry text. function activate() end + +--- +-- Adds a browser prefix to the list of browsers available in the project +-- manager entry combo box. +-- @param prefix The text to add. +function add_browser(prefix) end 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) diff --git a/core/.view.lua b/core/.view.lua index ff8a1cf7..2214463f 100644 --- a/core/.view.lua +++ b/core/.view.lua @@ -13,9 +13,11 @@ module('view') -- It also represents the structure of any view table in 'views'. -- @class table -- @name view +-- @field doc_pointer The pointer to the document associated with this view's +-- buffer. (Used internally; read-only) -- @field size The integer position of the split resizer (if this view is part -- of a split view). -view = { size = nil } +view = { doc_pointer = nil, size = nil } --- -- Splits the indexed view vertically or horizontally and focuses the new view. diff --git a/core/events.lua b/core/events.lua index 8a2f86b8..1f8b5682 100644 --- a/core/events.lua +++ b/core/events.lua @@ -506,6 +506,6 @@ end --- -- Default error handler. --- Opens a new buffer (if one hasn't already been opened) for printing errors. +-- Prints the errors to an error buffer. -- @param ... Error strings. function error(...) textadept._print('shows_errors', ...) end |