diff options
author | 2013-09-13 23:06:56 -0400 | |
---|---|---|
committer | 2013-09-13 23:06:56 -0400 | |
commit | bb7336a4dff7c68b65c50dce1818917c3416de0c (patch) | |
tree | 9b287e51f3eb8ad286ac1406f40f38b24db2e524 | |
parent | f37276331fe1e146193b45e380911b7a60e11de4 (diff) | |
download | textadept-bb7336a4dff7c68b65c50dce1818917c3416de0c.tar.gz textadept-bb7336a4dff7c68b65c50dce1818917c3416de0c.zip |
Updated some LuaDoc.
-rw-r--r-- | core/.buffer.luadoc | 31 | ||||
-rw-r--r-- | core/init.lua | 12 | ||||
-rw-r--r-- | modules/textadept/command_entry.lua | 2 | ||||
-rw-r--r-- | modules/textadept/editing.lua | 14 |
4 files changed, 29 insertions, 30 deletions
diff --git a/core/.buffer.luadoc b/core/.buffer.luadoc index 82a363ae..1c359304 100644 --- a/core/.buffer.luadoc +++ b/core/.buffer.luadoc @@ -68,15 +68,15 @@ -- -- The default value is `buffer.ANNOTATION_HIDDEN`. -- @field auto_c_auto_hide (bool) --- Automatically hide the autocompletion list when no entries match typed --- text. +-- Automatically hide the autocompletion or user list when no entries match +-- typed text. -- The default value is `true`. -- @field auto_c_cancel_at_start (bool) --- Cancel autocompletion when backspacing to a position before where --- autocompletion started instead of before the word being completed. +-- Cancel an autocompletion or user list when backspacing to a position before +-- where autocompletion started instead of before the word being completed. -- The default value is `true`. -- @field auto_c_case_insensitive_behaviour (number) --- The behavior mode for case insensitive autocompletion when +-- The behavior mode for a case insensitive autocompletion or user list when -- [`buffer.auto_c_ignore_case`](#auto_c_ignore_case) is `true`. -- -- * `buffer.SC_CASEINSENSITIVEBEHAVIOR_RESPECTCASE` @@ -97,10 +97,11 @@ -- The default value is `false`. -- @field auto_c_fill_ups (string, Write-only) -- The set of characters that choose the currently selected item in an --- autocompletion list when typed. +-- autocompletion or user list when typed. -- The default value is an empty string. -- @field auto_c_ignore_case (bool) --- Ignore case when searching an autocompletion list for matches. +-- Ignore case when searching an autocompletion or user list for +-- matches. -- The default value is `false`. -- @field auto_c_max_height (number) -- The maximum number of items per page to show in autocompletion and user @@ -127,7 +128,7 @@ -- The byte value of the character that separates autocompletion list items. -- The default value is `32` (' '). -- @field auto_c_type_separator (number) --- The character byte that separates autocompletion list items and their +-- The character byte that separates autocompletion and list items and their -- image types. -- Autocompletion list items can display both an image and text. Register -- images and their types using [`buffer:register_image()`](#register_image) @@ -142,10 +143,6 @@ -- Buffering draws each line of text into a bitmap buffer before drawing the -- bitmap to the screen. -- The default value is `true`. --- @field call_tip_back (number, Write-only) --- The background color, in "0xBBGGRR" format, of call tips. --- @field call_tip_fore (number, Write-only) --- The foreground color, in "0xBBGGRR" format, of call tips. -- @field call_tip_fore_hlt (number, Write-only) -- The foreground color, in "0xBBGGRR" format, of the highlighted part of -- call tips. @@ -567,7 +564,7 @@ -- @field property (table) -- Map of key-value string pairs used by lexers. -- @field property_expanded (table, Read-only) --- Map of key-value string pairs used by lexers with `$()` variable +-- Map of key-value string pairs used by lexers with `%()` variable -- replacement performed in values. -- @field property_int (table, Read-only) -- Map of key-value pairs used by lexers with values interpreted as numbers, @@ -1008,8 +1005,8 @@ function auto_c_select(buffer, string) end function auto_c_show(buffer, len_entered, item_list) end --- --- Defines string *chars* as the set of characters that cancel autocompletion --- when typed. +-- Defines string *chars* as the set of characters that cancels an +-- autocompletion or user list when typed. -- The default set is an empty string. -- @param buffer The global buffer. -- @param chars The string of characters that cancel autocompletion. This string @@ -1128,7 +1125,7 @@ function can_redo(buffer) end function can_undo(buffer) end --- --- Cancels the active call tip, autocompletion list, user list, selection mode, +-- Cancels the active call tip, autocompletion or user list, selection mode, -- etc. -- @param buffer The global buffer. function cancel(buffer) end @@ -2741,6 +2738,8 @@ function set_lexer(buffer, lang) end -- Unused Fields. -- * annotation_styles -- * automatic_fold +-- * call_tip_back +-- * call_tip_fore -- * character_pointer -- * code_page -- * direct_function diff --git a/core/init.lua b/core/init.lua index 76c35c08..a165966e 100644 --- a/core/init.lua +++ b/core/init.lua @@ -21,7 +21,7 @@ if jit then module, package.searchers, bit32 = nil, package.loaders, bit end --- -- Extends Lua's _G table to provide extra functions and fields for Textadept. -- @field _HOME (string) --- The path to the directory containing Textadept. +-- The path to Textadept's home, or installation directory. -- @field _RELEASE (string) -- The Textadept release version string. -- @field _USERHOME (string) @@ -33,14 +33,14 @@ if jit then module, package.searchers, bit32 = nil, package.loaders, bit end -- machines *~/* is the value of "$HOME", typically */home/username/* and -- */Users/username/* respectively. -- @field _CHARSET (string) --- The character set encoding of the filesystem. +-- The character encoding of the filesystem. -- This is used when [working with files](io.html). -- @field WIN32 (bool) --- If Textadept is running on Windows, this flag is `true`. +-- Whether or not Textadept is running on Windows. -- @field OSX (bool) --- If Textadept is running on Mac OSX, this flag is `true`. +-- Whether or not Textadept is running on Mac OSX. -- @field CURSES (bool) --- If Textadept is running in the terminal, this flag is `true`. +-- Whether or not Textadept is running in the terminal. -- Curses feature incompatibilities are listed in the [Appendix][]. -- -- [Appendix]: ../14_Appendix.html#Curses.Compatibility @@ -84,7 +84,7 @@ local _VIEWS local buffer --- --- The currently focused [view](view.html). +-- The current [view](view.html). -- @class table -- @name view local view diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua index e5ec6903..103ea54b 100644 --- a/modules/textadept/command_entry.lua +++ b/modules/textadept/command_entry.lua @@ -168,7 +168,7 @@ end) local focus --- --- Shows the completion list *completions* for the current word prefix. +-- Shows completion list *completions* for the current word prefix. -- Word prefix characters are alphanumerics and underscores. On selection, the -- word prefix is replaced with the completion. -- @param completions The table of completions to show. Non-string values are diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 97935f13..143d07f5 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -25,7 +25,7 @@ local M = {} -- Match the indentation level of the previous line when inserting a new line. -- The default value is `true`. -- @field STRIP_TRAILING_SPACES (bool) --- Strip trailing whitespace on file save. +-- Strip trailing whitespace before saving files. -- The default value is `true`. -- @field INDIC_HIGHLIGHT (number) -- The word highlight indicator number. @@ -202,24 +202,24 @@ function M.match_brace(select) end --- --- Displays an autocompletion list, built from the set of *default_words* and --- existing words in the buffer, for the word behind the caret, returning `true` --- if completions were found. --- @param default_words Optional list of words considered to be in the buffer, +-- Displays an autocompletion list, built from the set of string words *words* +-- and existing words in the buffer, for the word behind the caret, returning +-- `true` if completions were found. +-- @param words Optional list of words considered to be in the buffer, -- even if they are not. Words may contain [registered images][]. -- -- [registered images]: buffer.html#register_image -- @return `true` if there were completions to show; `false` otherwise. -- @see buffer.word_chars -- @name autocomplete_word -function M.autocomplete_word(default_words) +function M.autocomplete_word(words) local buffer = buffer local pos, length = buffer.current_pos, buffer.length local completions, c_list = {}, {} local buffer_text = buffer:get_text() local root = buffer_text:sub(1, pos):match('['..buffer.word_chars..']+$') if not root or root == '' then return end - for _, word in ipairs(default_words or {}) do + for _, word in ipairs(words or {}) do if word:match('^'..root) then c_list[#c_list + 1], completions[word:match('^(.-)%??%d*$')] = word, true end |