diff options
Diffstat (limited to 'modules/textadept')
-rw-r--r-- | modules/textadept/adeptsense.lua | 53 | ||||
-rw-r--r-- | modules/textadept/bookmarks.lua | 4 | ||||
-rw-r--r-- | modules/textadept/command_entry.lua | 3 | ||||
-rw-r--r-- | modules/textadept/editing.lua | 36 | ||||
-rw-r--r-- | modules/textadept/find.lua | 68 | ||||
-rw-r--r-- | modules/textadept/menu.lua | 2 | ||||
-rw-r--r-- | modules/textadept/mime_types.lua | 22 | ||||
-rw-r--r-- | modules/textadept/run.lua | 14 | ||||
-rw-r--r-- | modules/textadept/session.lua | 24 | ||||
-rw-r--r-- | modules/textadept/snapopen.lua | 14 | ||||
-rw-r--r-- | modules/textadept/snippets.lua | 2 |
11 files changed, 133 insertions, 109 deletions
diff --git a/modules/textadept/adeptsense.lua b/modules/textadept/adeptsense.lua index cdc6c126..d168c5a6 100644 --- a/modules/textadept/adeptsense.lua +++ b/modules/textadept/adeptsense.lua @@ -314,16 +314,19 @@ module('_M.textadept.adeptsense')]] -- -- #### Other Adeptsense Settings -- --- * `always_show_globals` [bool]: Include globals in the list of completions --- offered. Globals are classes, functions, and fields that do not belong to --- another class. They are contained in `completions['']`. The default value --- is `true`. +-- * `always_show_globals` [bool] +-- Include globals in the list of completions offered. +-- Globals are classes, functions, and fields that do not belong to another +-- class. They are contained in `completions['']`. The default value is +-- `true`. -- -- ## Settings -- --- * `FUNCTIONS` [string]: XPM image for Adeptsense functions. --- * `FIELDS` [string]: XPM image for Adeptsense fields. +-- * `FUNCTIONS` [string] +-- XPM image for Adeptsense functions. +-- * `FIELDS` [string] +-- XPM image for Adeptsense fields. local senses = {} @@ -415,10 +418,10 @@ end -- Adds an inherited class's completions to the given completion list. -- @param sense The Adeptsense returned by `adeptsense.new()`. -- @param class The name of the class to add inherited completions from. --- @param only_fields If `true`, adds only fields to the completion list; --- defaults to `false`. --- @param only_funcs If `true`, adds only functions to the completion list; --- defaults to `false`. +-- @param only_fields If `true`, adds only fields to the completion list. The +-- default value is `false`. +-- @param only_funcs If `true`, adds only functions to the completion list. The +-- default value is `false`. -- @param c The completion list to add completions to. -- @param added Table that keeps track of what inherited classes have been -- added. This prevents stack overflow errors. Should be `{}` on the initial @@ -446,10 +449,10 @@ end -- Returns a list of completions for the given symbol. -- @param sense The Adeptsense returned by `adeptsense.new()`. -- @param symbol The symbol to get completions for. --- @param only_fields If `true`, returns list of only fields; defaults to --- `false`. --- @param only_functions If `true`, returns list of only functions; defaults to --- `false`. +-- @param only_fields If `true`, returns list of only fields. The default value +-- is `false`. +-- @param only_functions If `true`, returns list of only functions. The default +-- value is `false`. -- @return completion_list or `nil` -- @name get_completions function M.get_completions(sense, symbol, only_fields, only_functions) @@ -501,10 +504,10 @@ end --- -- Shows an autocompletion list for the symbol behind the caret. -- @param sense The Adeptsense returned by `adeptsense.new()`. --- @param only_fields If `true`, returns list of only fields; defaults to --- `false`. --- @param only_functions If `true`, returns list of only functions; defaults to --- `false1. +-- @param only_fields If `true`, returns list of only fields. The default value +-- is `false`. +-- @param only_functions If `true`, returns list of only functions. The default +-- value is `false`. -- @return `true` on success or `false`. -- @see get_symbol -- @see get_completions @@ -532,10 +535,10 @@ end -- @param sense The Adeptsense returned by `adeptsense.new()`. -- @param c The character(s) that triggers the autocompletion. You can have up -- to two characters. --- @param only_fields If `true`, this trigger only completes fields. Defaults to --- `false`. +-- @param only_fields If `true`, this trigger only completes fields. The default +-- value is `false`. -- @param only_functions If `true`, this trigger only completes functions. --- Defaults to `false`. +-- The default value is `false`. -- @usage sense:add_trigger('.') -- @usage sense:add_trigger(':', false, true) -- only functions -- @usage sense:add_trigger('->') @@ -645,7 +648,7 @@ end -- @param sense The Adeptsense returned by `adeptsense.new()`. -- @param tag_file The path of the ctags file to load. -- @param nolocations If `true`, does not store the locations of the tags for --- use by `goto_ctag()`. Defaults to `false`. +-- use by `goto_ctag()`. The default value is `false`. -- @name load_ctags function M.load_ctags(sense, tag_file, nolocations) local ctags_kinds = sense.ctags_kinds @@ -876,7 +879,7 @@ api_files = {}, -- are shown (if any). Completions will not be shown for both a class and -- superclass unless defined in a previously loaded ctags file. Also, multiple -- superclasses cannot be recognized by this pattern; use a ctags file --- instead. Defaults to `'class%s+([%w_]+)'`. +-- instead. The default value is `'class%s+([%w_]+)'`. -- @field word_chars A Lua pattern of characters allowed in a word. The default -- is `'%w_'`. -- @field symbol_chars A Lua pattern of characters allowed in a symbol, @@ -884,11 +887,11 @@ api_files = {}, -- default is `'[%w_%.]'`. -- @field type_declarations A list of Lua patterns used for determining the -- class type of a symbol. The first capture returned must be the class name. --- Use `%_` to match the symbol. The default is `'(%u[%w_%.]+)%s+%_'`. +-- Use `%_` to match the symbol. The default value is `'(%u[%w_%.]+)%s+%_'`. -- @field type_declarations_exclude A table of types to exclude, even if they -- match a type_declaration pattern. Each excluded type is a table key and has -- a `true` boolean value. For example, `{ Foo = true }` excludes any type --- whose name is `Foo`. Defaults to being empty. +-- whose name is `Foo`. The default value is `{}`. -- @field type_assignments A map of Lua patterns to class types for variable -- assignments. This is typically used for dynamically typed languages. For -- example, `sense.type_assignments['^"'] = 'string'` would recognize string diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua index 04170902..77f3194b 100644 --- a/modules/textadept/bookmarks.lua +++ b/modules/textadept/bookmarks.lua @@ -10,8 +10,8 @@ module('_M.textadept.bookmarks')]] -- Markdown: -- ## Settings -- --- * `MARK_BOOKMARK_COLOR` [number]: The color used for a bookmarked line in --- `0xBBGGRR` format. +-- * `MARK_BOOKMARK_COLOR` [number] +-- The color used for a bookmarked line in `0xBBGGRR` format. M.MARK_BOOKMARK_COLOR = 0xB3661A diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua index 92490ddc..adccc7b9 100644 --- a/modules/textadept/command_entry.lua +++ b/modules/textadept/command_entry.lua @@ -9,7 +9,8 @@ module('gui.command_entry')]] -- Markdown: -- ## Fields -- --- * `entry_text` [string]: The text in the entry. +-- * `entry_text` [string] +-- The text in the entry. -- Environment for abbreviated commands. -- @class table diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index c8850662..aafc358c 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -10,21 +10,29 @@ module('_M.textadept.editing')]] -- Markdown: -- ## Settings -- --- * `AUTOPAIR` [bool]: Opening `(`, `[`, `[`, `"`, or `'` characters are --- automatically closed. The default value is `true`. --- * `HIGHLIGHT_BRACES` [bool]: Highlight matching `()[]{}<>` characters. The --- default value is `true`. --- * `AUTOINDENT` [bool]: Match the indentation level of the previous line when --- pressing the Enter key. The default value is `true`. --- * `STRIP_WHITESPACE_ON_SAVE` [bool]: Strip trailing whitespace on file save. +-- * `AUTOPAIR` [bool] +-- Opening `(`, `[`, `[`, `"`, or `'` characters are automatically closed. -- The default value is `true`. --- * `MARK_HIGHLIGHT_BACK` [number]: The background color used for a line --- containing a highlighted word in `0xBBGGRR` format. --- * `INDIC_HIGHLIGHT_BACK` [number]: The color used for an indicator for a --- highlighted word in `0xBBGGRR` format. --- * `INDIC_HIGHLIGHT_ALPHA` [number]: The alpha transparency value between `0` --- (transparent) and `255` (opaque) used for an indicator for a highlighted --- word. The default value is `100`. +-- * `HIGHLIGHT_BRACES` [bool] +-- Highlight matching `()[]{}<>` characters. +-- The default value is `true`. +-- * `AUTOINDENT` [bool] +-- Match the indentation level of the previous line when pressing the Enter +-- key. +-- The default value is `true`. +-- * `STRIP_WHITESPACE_ON_SAVE` [bool] +-- Strip trailing whitespace on file save. +-- The default value is `true`. +-- * `MARK_HIGHLIGHT_BACK` [number] +-- The background color used for a line containing a highlighted word in +-- `0xBBGGRR` format. +-- * `INDIC_HIGHLIGHT_BACK` [number] +-- The color used for an indicator for a highlighted word in `0xBBGGRR` +-- format. +-- * `INDIC_HIGHLIGHT_ALPHA` [number] +-- The alpha transparency value between `0` (transparent) and `255` (opaque) +-- used for an indicator for a highlighted word. +-- The default value is `100`. M.AUTOPAIR = true M.HIGHLIGHT_BRACES = true diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 31ec6d31..1062e60b 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -10,32 +10,48 @@ module('gui.find')]] -- Markdown: -- ## Fields -- --- * `find_entry_text` [string]: The text in the find entry. --- * `replace_entry_text` [string]: The text in the replace entry. --- * `match_case` [bool]: Searches are case-sensitive. --- * `whole_word` [bool]: Only whole-word matches are allowed in searches. --- * `lua` [bool]: The search text is interpreted as a Lua pattern. --- * `in_files` [bool]: Search for the text in a list of files. --- * `find_label_text` [string]: The text of the 'Find' label. This is primarily --- used for localization. (Write-only) --- * `replace_label_text` [string]: The text of the 'Replace' label. This is --- primarily used for localization. (Write-only) --- * `find_next_button_text` [string]: The text of the 'Find Next' button. This --- is primarily used for localization. (Write-only) --- * `find_prev_button_text` [string]: The text of the 'Find Prev' button. This --- is primarily used for localization. (Write-only) --- * `replace_button_text` [string]: The text of the 'Replace' button. This is --- primarily used for localization. (Write-only) --- * `replace_all_button_text` [string]: The text of the 'Replace All' button. --- This is primarily used for localization. (Write-only) --- * `match_case_label_text` [string]: The text of the 'Match case' label. This --- is primarily used for localization. (Write-only) --- * `whole_word_label_text` [string]: The text of the 'Whole word' label. This --- is primarily used for localization. (Write-only) --- * `lua_pattern_label_text` [string]: The text of the 'Lua pattern' label. --- This is primarily used for localization. (Write-only) --- * `in_files_label_text` [string]: The text of the 'In files' label. This is --- primarily used for localization. (Write-only) +-- * `find_entry_text` [string] +-- The text in the find entry. +-- * `replace_entry_text` [string] +-- The text in the replace entry. +-- * `match_case` [bool] +-- Searches are case-sensitive. +-- * `whole_word` [bool] +-- Only whole-word matches are allowed in searches. +-- * `lua` [bool] +-- The search text is interpreted as a Lua pattern. +-- * `in_files` [bool] +-- Search for the text in a list of files. +-- * `find_label_text` [string] (Write-only) +-- The text of the 'Find' label. +-- This is primarily used for localization. +-- * `replace_label_text` [string] (Write-only) +-- The text of the 'Replace' label. +-- This is primarily used for localization. +-- * `find_next_button_text` [string] (Write-only) +-- The text of the 'Find Next' button. +-- This is primarily used for localization. +-- * `find_prev_button_text` [string] (Write-only) +-- The text of the 'Find Prev' button. +-- This is primarily used for localization. +-- * `replace_button_text` [string] (Write-only) +-- The text of the 'Replace' button. +-- This is primarily used for localization. +-- * `replace_all_button_text` [string] (Write-only) +-- The text of the 'Replace All' button. +-- This is primarily used for localization. +-- * `match_case_label_text` [string] (Write-only) +-- The text of the 'Match case' label. +-- This is primarily used for localization. +-- * `whole_word_label_text` [string] (Write-only) +-- The text of the 'Whole word' label. +-- This is primarily used for localization. +-- * `lua_pattern_label_text` [string] (Write-only) +-- The text of the 'Lua pattern' label. +-- This is primarily used for localization. +-- * `in_files_label_text` [string] (Write-only) +-- The text of the 'In files' label. +-- This is primarily used for localization. local _L = _L find.find_label_text = _L['Find:'] diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua index cb59d663..40a71d70 100644 --- a/modules/textadept/menu.lua +++ b/modules/textadept/menu.lua @@ -244,7 +244,7 @@ local menu_actions, contextmenu_actions = {}, {} -- Also assigns key commands. -- @param menu The menu to create a gtkmenu from. -- @param contextmenu Flag indicating whether or not the menu is a context menu. --- If so, menu_id offset is 1000. Defaults to `false`. +-- If so, menu_id offset is 1000. The default value is `false`. -- @return gtkmenu that can be passed to `gui.gtkmenu()`. -- @see gui.gtkmenu local function read_menu_table(menu, contextmenu) diff --git a/modules/textadept/mime_types.lua b/modules/textadept/mime_types.lua index 27d08de5..7869ea17 100644 --- a/modules/textadept/mime_types.lua +++ b/modules/textadept/mime_types.lua @@ -8,25 +8,13 @@ local M = {} module('_M.textadept.mime_types')]] -- Markdown: --- ## Overview --- --- This module adds an extra function to `buffer`: --- --- * **buffer:set\_lexer** (language)<br /> --- Replacement for [`buffer:set_lexer_language()`][buffer_set_lexer_language]. --- <br /> 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.<br /> --- Loads the language-specific module if it exists. --- - lang: The string language to set. --- --- [buffer_set_lexer_language]: buffer.html#buffer:set_lexer_language --- -- ## Mime-type Events -- --- * `_G.events.LANGUAGE_MODULE_LOADED`: Called when loading a language-specific --- module. This is useful for overriding its key commands since they are not --- available when Textadept starts. Arguments:<br /> +-- * `_G.events.LANGUAGE_MODULE_LOADED` +-- Called when loading a language-specific module. +-- This is useful for overriding its key commands since they are not available +-- when Textadept starts. +-- Arguments: -- * `lang`: The language lexer name. -- Events. diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index f200bd83..4f1aea0c 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -13,18 +13,22 @@ module('_M.textadept.run')]] -- Markdown: -- ## Run Events -- --- * `_G.events.COMPILE_OUTPUT`: Called after a compile command is executed. +-- * `_G.events.COMPILE_OUTPUT` +-- Called after a compile command is executed. -- When connecting to this event (typically from a language-specific module), -- connect with an index of `1` and return `true` if the event was handled and -- you want to override the default handler that prints the output to a new --- view.<br /> +-- view. +-- Arguments: -- * `lexer`: The lexer language. -- * `output`: The output from the command. --- * `_G.events.RUN_OUTPUT`: Called after a run command is executed. When --- connecting to this event (typically from a language-specific module), +-- * `_G.events.RUN_OUTPUT` +-- Called after a run command is executed. +-- When connecting to this event (typically from a language-specific module), -- connect with an index of `1` and return `true` if the event was handled and -- you want to override the default handler that prints the output to a new --- view.<br /> +-- view. +-- Arguments: -- * `lexer`: The lexer language. -- * `output`: The output from the command. diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua index 59d0814b..b835c49a 100644 --- a/modules/textadept/session.lua +++ b/modules/textadept/session.lua @@ -10,12 +10,16 @@ module('_M.textadept.session')]] -- Markdown: -- ## Settings -- --- * `DEFAULT_SESSION` [string]: The path to the default session file. --- * `SAVE_ON_QUIT` [bool]: Save the session when quitting. The default value is --- `true` and can be disabled by passing the command line switch `-n` or --- `--nosession` to Textadept. --- * `MAX_RECENT_FILES` [number]: The maximum number of files from the recent --- files list to save to the session. The default is `10`. +-- * `DEFAULT_SESSION` [string] +-- The path to the default session file. +-- * `SAVE_ON_QUIT` [bool] +-- Save the session when quitting. +-- The default value is `true` and can be disabled by passing the command line +-- switch `-n` or `--nosession` to Textadept. +-- * `MAX_RECENT_FILES` [number] +-- The maximum number of files from the recent files list to save to the +-- session. +-- The default value is `10`. M.DEFAULT_SESSION = _USERHOME..'/session' M.SAVE_ON_QUIT = true @@ -25,8 +29,8 @@ M.MAX_RECENT_FILES = 10 -- Loads a Textadept session file. -- Textadept restores split views, opened buffers, cursor information, and -- project manager details. --- @param filename The absolute path to the session file to load. Defaults to --- `DEFAULT_SESSION` if not specified. +-- @param filename The absolute path to the session file to load. The default +-- value is `DEFAULT_SESSION`. -- @return `true` if the session file was opened and read; `false` otherwise. -- @usage _M.textadept.session.load(filename) -- @name load @@ -105,8 +109,8 @@ events.connect('arg_none', function() if M.SAVE_ON_QUIT then M.load() end end) -- Saves a Textadept session to a file. -- Saves split views, opened buffers, cursor information, and project manager -- details. --- @param filename The absolute path to the session file to save. Defaults to --- either the current session file or `DEFAULT_SESSION` if not specified. +-- @param filename The absolute path to the session file to save. The default +-- value is either the current session file or `DEFAULT_SESSION`. -- @usage _M.textadept.session.save(filename) -- @name save function M.save(filename) diff --git a/modules/textadept/snapopen.lua b/modules/textadept/snapopen.lua index ddbb489f..3b9d6622 100644 --- a/modules/textadept/snapopen.lua +++ b/modules/textadept/snapopen.lua @@ -10,10 +10,10 @@ module('_M.textadept.snapopen')]] -- Markdown: -- ## Settings -- --- * `DEFAULT_DEPTH` [number]: Maximum directory depth to search. The default --- value is `4`. --- * `MAX` [number]: Maximum number of files to list. The default value is --- `1000`. +-- * `DEFAULT_DEPTH` [number] +-- Maximum directory depth to search. The default value is `4`. +-- * `MAX` [number] +-- Maximum number of files to list. The default value is `1000`. -- -- ## Examples -- @@ -111,12 +111,12 @@ end -- excluded by adding filters to a table assigned to a `folders` key in the -- filter table. All strings should be UTF-8 encoded. -- @param exclude_PATHS Flag indicating whether or not to exclude `PATHS` in the --- search. Defaults to `false`. +-- search. The default value is `false`. -- @param exclude_FILTER Flag indicating whether or not to exclude `FILTER` from -- `filter` in the search. If false, adds `FILTER` to the given `filter`. --- Defaults to `false`. +-- The default value is `false`. -- @param depth Number of directories to recurse into for finding files. --- Defaults to `DEFAULT_DEPTH`. +-- The default value is `DEFAULT_DEPTH`. -- @usage _M.textadept.snapopen.open() -- @usage _M.textadept.snapopen.open(buffer.filename:match('^.+/'), nil, true) -- @usage _M.textadept.snapopen.open(nil, '!%.lua$') diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua index bbf53c36..a99a51b8 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -294,7 +294,7 @@ M._snippet_mt = { -- slightly different when `complete` true. -- @param text Text to unescape. -- @param complete Flag indicating whether or not to also remove the extra - -- escape character '%'. Defaults to `false`. + -- escape character '%'. The default value is `false`. unescape_text = function(text, complete) text = text:gsub('\027.', escapes) return complete and text:gsub('%%([%%%(%)>%]])', '%1') or text |