diff options
Diffstat (limited to 'core/ext')
-rw-r--r-- | core/ext/find.lua | 24 | ||||
-rw-r--r-- | core/ext/keys.lua | 29 | ||||
-rw-r--r-- | core/ext/mime_types.lua | 8 |
3 files changed, 20 insertions, 41 deletions
diff --git a/core/ext/find.lua b/core/ext/find.lua index c68b97e3..de59c576 100644 --- a/core/ext/find.lua +++ b/core/ext/find.lua @@ -10,17 +10,13 @@ local MARK_FIND = 0 local MARK_FIND_COLOR = 0x4D9999 local previous_view ---- --- [Local table] Text escape sequences with their associated characters. --- @class table --- @name escapes +-- Text escape sequences with their associated characters. local escapes = { ['\\a'] = '\a', ['\\b'] = '\b', ['\\f'] = '\f', ['\\n'] = '\n', ['\\r'] = '\r', ['\\t'] = '\t', ['\\v'] = '\v', ['\\\\'] = '\\' } ---- --- [Local function] Finds and selects text in the current buffer. +-- Finds and selects text in the current buffer. -- @param text The text to find. -- @param next Flag indicating whether or not the search direction is forward. -- @param flags Search flags. This is a number mask of 4 flags: match case (2), @@ -156,9 +152,8 @@ local function find_(text, next, flags, nowrap, wrapped) end textadept.events.add_handler('find', find_) ---- --- [Local function] Finds and selects text incrementally in the current buffer --- from a start point. +-- Finds and selects text incrementally in the current buffer from a start +-- point. -- Flags other than SCFIND_MATCHCASE are ignored. -- @param text The text to find. local function find_incremental(text) @@ -205,8 +200,7 @@ textadept.events.add_handler('command_entry_command', end end, 1) -- place before command_entry.lua's handler (if necessary) ---- --- [Local function] Replaces found text. +-- Replaces found text. -- 'find_' is called first, to select any found text. The selected text is then -- replaced by the specified replacement text. -- This function ignores 'Find in Files'. @@ -251,8 +245,7 @@ local function replace(rtext) end textadept.events.add_handler('replace', replace) ---- --- [Local function] Replaces all found text. +-- Replaces all found text. -- If any text is selected, all found text in that selection is replaced. -- This function ignores 'Find in Files'. -- @param ftext The text to find. @@ -300,9 +293,8 @@ local function replace_all(ftext, rtext, flags) end textadept.events.add_handler('replace_all', replace_all) ---- --- [Local function] When the user double-clicks a found file, go to the line in --- the file the text was found at. +-- When the user double-clicks a found file, go to the line in the file the text +-- was found at. -- @param pos The position of the caret. -- @param line_num The line double-clicked. local function goto_file(pos, line_num) diff --git a/core/ext/keys.lua b/core/ext/keys.lua index b6d4c6d0..5a27f36a 100644 --- a/core/ext/keys.lua +++ b/core/ext/keys.lua @@ -81,7 +81,7 @@ local ALT = 'a'..ADD --- -- Global container that holds all key commands. -- @class table --- @name keys +-- @name _G.keys _G.keys = {} -- optimize for speed @@ -96,12 +96,9 @@ local type = _G.type local unpack = _G.unpack local MAC = _G.MAC ---- --- [Local table] Lookup table for key values higher than 255. +-- Lookup table for key values higher than 255. -- If a key value given to 'keypress' is higher than 255, this table is used to -- return a string representation of the key if it exists. --- @class table --- @name KEYSYMS local KEYSYMS = { -- from <gdk/gdkkeysyms.h> [65056] = '\t', -- backtab; will be 'shift'ed [65288] = '\b', @@ -123,9 +120,7 @@ local KEYSYMS = { -- from <gdk/gdkkeysyms.h> [65478] = 'f9', [65479] = 'f10', [65480] = 'f11', [65481] = 'f12', } ---- [Local table] The current key sequence. --- @class table --- @name keychain +-- The current key sequence. local keychain = {} -- local functions @@ -138,8 +133,7 @@ function clear_key_sequence() textadept.statusbar_text = '' end ---- --- [Local function] Handles Textadept keypresses. +-- Handles Textadept keypresses. -- It is called every time a key is pressed, and based on lexer and scope, -- executes a command. The command is looked up in the global 'keys' key -- command table. @@ -219,28 +213,23 @@ local function keypress(code, shift, control, alt) end textadept.events.add_handler('keypress', keypress, 1) ---- --- [Local function] Tries to get a key command based on the lexer and current --- scope. +-- Tries to get a key command based on the lexer and current scope. try_get_cmd1 = function(keys, lexer, scope) return try_get_cmd(keys[lexer][scope]) end ---- --- [Local function] Tries to get a key command based on the lexer. +-- Tries to get a key command based on the lexer. try_get_cmd2 = function(keys, lexer) return try_get_cmd(keys[lexer]) end ---- --- [Local function] Tries to get a global key command. +-- Tries to get a global key command. try_get_cmd3 = function(keys) return try_get_cmd(keys) end ---- --- [Local function] Helper function that gets commands associated with the --- current keychain from 'keys'. +-- Helper function that gets commands associated with the current keychain from +-- 'keys'. -- If the current item in the keychain is part of a chain, throw an error value -- of -1. This way, pcall will return false and -1, where the -1 can easily and -- efficiently be checked rather than using a string error message. diff --git a/core/ext/mime_types.lua b/core/ext/mime_types.lua index f411ab89..e6412884 100644 --- a/core/ext/mime_types.lua +++ b/core/ext/mime_types.lua @@ -44,7 +44,7 @@ if f then end --- --- [Local function] Replacement for buffer:set_lexer_language(). +-- Replacement for buffer:set_lexer_language(). -- Sets a buffer._lexer field so it can be restored without querying the -- mime-types tables. Also if the user manually sets the lexer, it should be -- restored. @@ -58,8 +58,7 @@ end textadept.events.add_handler('buffer_new', function() buffer.set_lexer = set_lexer end) ---- --- [Local function] Performs actions suitable for a new buffer. +-- Performs actions suitable for a new buffer. -- Sets the buffer's lexer language and loads the language module. local function handle_new() local lexer @@ -97,8 +96,7 @@ local function handle_new() end end ---- --- [Local function] Sets the buffer's lexer based on filename, shebang words, or +-- Sets the buffer's lexer based on filename, shebang words, or -- first line pattern. local function restore_lexer() buffer:set_lexer_language(buffer._lexer or 'container') |