diff options
author | 2011-09-27 21:20:33 -0400 | |
---|---|---|
committer | 2011-09-27 21:20:33 -0400 | |
commit | 132e362f44e00cd93e04967efbfc138c53a47ee4 (patch) | |
tree | 9d68dcdca8d687e922a277f137813a09d9b4b12d | |
parent | 43e9f2528415e8f2d43e7ba65f0d4c5b5d5adff4 (diff) | |
download | textadept-132e362f44e00cd93e04967efbfc138c53a47ee4.tar.gz textadept-132e362f44e00cd93e04967efbfc138c53a47ee4.zip |
Reformatted some LuaDoc.
-rw-r--r-- | core/._G.luadoc | 27 | ||||
-rw-r--r-- | core/.buffer.luadoc | 354 | ||||
-rw-r--r-- | core/.command_entry.luadoc | 3 | ||||
-rw-r--r-- | core/.find.luadoc | 2 | ||||
-rw-r--r-- | core/.gui.luadoc | 39 | ||||
-rw-r--r-- | core/.iconv.luadoc | 4 | ||||
-rw-r--r-- | core/.view.luadoc | 12 | ||||
-rw-r--r-- | core/args.lua | 9 | ||||
-rw-r--r-- | core/events.lua | 7 | ||||
-rw-r--r-- | core/file_io.lua | 12 | ||||
-rw-r--r-- | core/gui.lua | 6 | ||||
-rw-r--r-- | core/keys.lua | 16 | ||||
-rw-r--r-- | modules/textadept/adeptsense.lua | 164 | ||||
-rw-r--r-- | modules/textadept/bookmarks.lua | 2 | ||||
-rw-r--r-- | modules/textadept/editing.lua | 25 | ||||
-rw-r--r-- | modules/textadept/find.lua | 18 | ||||
-rw-r--r-- | modules/textadept/menu.lua | 23 | ||||
-rw-r--r-- | modules/textadept/mime_types.lua | 25 | ||||
-rw-r--r-- | modules/textadept/run.lua | 34 | ||||
-rw-r--r-- | modules/textadept/session.lua | 13 | ||||
-rw-r--r-- | modules/textadept/snapopen.lua | 17 | ||||
-rw-r--r-- | modules/textadept/snippets.lua | 40 |
22 files changed, 432 insertions, 420 deletions
diff --git a/core/._G.luadoc b/core/._G.luadoc index e2d8401c..94de2a73 100644 --- a/core/._G.luadoc +++ b/core/._G.luadoc @@ -37,7 +37,7 @@ arg = {} -- @class table -- @name _BUFFERS -- @usage _BUFFERS[1] contains the first buffer. --- @usage _BUFFERS[_BUFFERS[1]] evaluates to 1, the index of the first buffer. +-- @usage _BUFFERS[buffer] returns the index of the current buffer in _BUFFERS. _BUFFERS = {} --- @@ -47,42 +47,43 @@ _BUFFERS = {} -- @class table -- @name _VIEWS -- @usage _VIEWS[1] contains the first view. --- @usage _VIEWS[_VIEWS[1]] evaluates to 1, the index of the first view. +-- @usage _VIEWS[view] returns the index of the current view in _VIEWS. _VIEWS = {} --- -- Creates a new buffer. --- Activates the 'buffer_new' signal. +-- Generates a `BUFFER_NEW` event. -- @return the new buffer. function new_buffer() end --- -- Calls a given function after an interval of time. --- To repeatedly call the function, return true inside the function. A nil or --- false return value stops repetition. +-- To repeatedly call the function, return true inside the function. A `nil` or +-- `false` return value stops repetition. -- @param interval The interval in seconds to call the function after. -- @param f The function to call. --- @param ... Additional arguments to pass to f. +-- @param ... Additional arguments to pass to `f`. function timeout(interval, f, ...) 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 keys.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 +-- This function is useful for modifying init scripts (such as the user's +-- `modules/textadept/keys.lua`) on the fly without having to restart Textadept. +-- `_G.RESETTING` 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. +--- +-- Quits Textadept. function quit() end --- --- Calls 'dofile' on the given filename in the user's Textadept directory. --- This is typically used for loading user files like key commands or snippets. +-- Calls `dofile()` on the given filename in the user's Textadept directory. -- Errors are printed to the Textadept message buffer. -- @param filename The name of the file (not path). -- @return true if successful; false otherwise. +-- @see dofile function user_dofile(filename) end diff --git a/core/.buffer.luadoc b/core/.buffer.luadoc index e5519c3f..1a0f7a28 100644 --- a/core/.buffer.luadoc +++ b/core/.buffer.luadoc @@ -4,23 +4,24 @@ --- -- The current buffer in the current view. --- It also represents the structure of any buffer table in 'buffers'. +-- It also represents the structure of any buffer table in `_G._BUFFER`. module('buffer') -- Markdown: -- ## Fields -- -- * `additional_caret_fore` [number]: The foreground color of additional carets --- in 0xBBGGRR format. +-- in `0xBBGGRR` format. -- * `additional_carets_blink` [bool]: Whether additional carets will blink. -- * `additional_carets_visible` [bool]: Whether additional carets are visible. -- * `additional_sel_alpha` [number]: The alpha of additional selections. --- Alpha ranges from 0 (transparent) to 255 (opaque) or 256 for no alpha. +-- Alpha ranges from `0` (transparent) to `255` (opaque) or `256` for no +-- alpha. -- * `additional_sel_back` [number]: The background color of additional --- selections in 0xBBGGRR format. `buffer:set_sel_back(true, ...)` must have +-- selections in `0xBBGGRR` format. `buffer:set_sel_back(true, ...)` must have -- been called previously for this to have an effect. -- * `additional_sel_fore` [number]: The foreground color of additional --- selections in 0xBBGGRR format. `buffer:set_sel_fore(true, ...)` must have +-- selections in `0xBBGGRR` format. `buffer:set_sel_fore(true, ...)` must have -- been called previously for this to have an effect. -- * `additional_selection_typing` [bool]: Whether typing can be performed into -- multiple selections. @@ -33,10 +34,10 @@ module('buffer') -- * `annotation_style_offset` [number]: The start of the range of style numbers -- used for annotations. Annotation styles may be completely separated from -- standard text styles by setting a style offset. For example, setting this --- to 512 would allow the annotation styles to be numbered from 512 upto 767 --- so they do not overlap styles set by lexers (or margins if margins offset --- is 256). Each style number set with `buffer.annotation_style` has the --- offset added before looking up the style. +-- to `512` would allow the annotation styles to be numbered from `512` upto +-- `767` so they do not overlap styles set by lexers (or margins if margins +-- offset is `256`). Each style number set with `buffer.annotation_style` has +-- the offset added before looking up the style. -- * `annotation_visible` [number]: The visibility of annotations.<br /> -- * `_SCINTILLA.constants.ANNOTATION_HIDDEN` (0): Annotations are not -- displayed. @@ -69,41 +70,42 @@ module('buffer') -- * `auto_c_max_height` [number]: The maximum height, in rows, of -- auto-completion and user lists. The default is 5 rows. -- * `auto_c_max_width` [number]: The maximum width, in characters, of --- auto-completion and user lists. Set to 0 to autosize to fit longest item, +-- auto-completion and user lists. Set to `0` to autosize to fit longest item, -- which is the default. -- * `auto_c_separator` [number]: The auto-completion list separator character -- byte. The default is the space character. -- * `auto_c_type_separator` [number]: The auto-completion list type-separator --- character byte. The default is '?'. Autocompletion list items may display +-- character byte. The default is `'?'`. Autocompletion list items may display -- an image as well as text. Each image is first registered with an integer -- type. Then this integer is included in the text of the list separated by a --- '?' from the text. +-- `?` from the text. -- * `back_space_un_indents` [bool]: Whether a backspace pressed when caret is -- within indentation unindents. -- * `buffered_draw` [bool]: Whether drawing is buffered. If drawing is buffered -- then each line of text is drawn into a bitmap buffer before drawing it to -- the screen to avoid flicker. The default is for drawing to be buffered. -- first or directly onto the screen. --- * `call_tip_back` [number]: The background color for the call tip in 0xBBGGRR --- format. (Write-only) --- * `call_tip_fore` [number]: The foreground color for the call tip in 0xBBGGRR --- format. (Write-only) +-- * `call_tip_back` [number]: The background color for the call tip in +-- `0xBBGGRR` format. (Write-only) +-- * `call_tip_fore` [number]: The foreground color for the call tip in +-- `0xBBGGRR` format. (Write-only) -- * `call_tip_fore_hlt` [number]: The foreground color for the highlighted part --- of the call tip in 0xBBGGRR format. (Write-only) +-- of the call tip in `0xBBGGRR` format. (Write-only) -- * `call_tip_use_style` [number]: Enable use of -- `_SCINTILLA.constants.STYLE_CALLTIP` and set call tip tab size in pixels. --- If the tab size is less than 1, Tab characters are not treated specially. --- * `caret_fore` [number]: The foreground color of the caret in 0xBBGGRR +-- If the tab size is less than `1`, Tab characters are not treated specially. +-- * `caret_fore` [number]: The foreground color of the caret in `0xBBGGRR` -- format. -- * `caret_line_back` [number]: The color of the background of the line --- containing the caret in 0xBBGGRR format. +-- containing the caret in `0xBBGGRR` format. -- * `caret_line_back_alpha` [number]: The background alpha of the caret line. --- Alpha ranges from 0 (transparent) to 255 (opaque) or 256 for no alpha. +-- Alpha ranges from `0` (transparent) to `255` (opaque) or `256` for no +-- alpha. -- * `caret_line_visible` [bool]: Whether the background of the line containing -- the caret is in a different color. -- * `caret_period` [number]: The time in milliseconds that the caret is on and --- off. Setting the period to 0 stops the caret blinking. The default value is --- 500 milliseconds. +-- off. Setting the period to `0` stops the caret blinking. The default value +-- is 500 milliseconds. -- * `caret_sticky` [number]: The caret preferred x position changing when the -- user types.<br /> -- * `_SCINTILLA.constants.SC_CARETSTICKY_OFF` (0): All text changes (and @@ -124,9 +126,9 @@ module('buffer') -- default value. -- * `_SCINTILLA.constants.CARETSTYLE_BLOCK` (2): A block caret. -- * `caret_width` [number]: The width of the insert mode caret in pixels. Can --- be 0, 1, 2 or 3 pixels. The default width is 1 pixel. This setting only --- affects the width of the cursor when the cursor style is set to line caret --- mode, it does not affect the width for a block caret. +-- be `0`, `1`, `2` or `3` pixels. The default width is 1 pixel. This setting +-- only affects the width of the cursor when the cursor style is set to line +-- caret mode, it does not affect the width for a block caret. -- * `char_at` [table]: Table of character bytes at positions in the document -- starting at zero. (Read-only) -- * `code_page` [number]: The code page used to interpret the bytes of the @@ -135,8 +137,8 @@ module('buffer') -- * `column` [table]: Table of column numbers, taking tab widths into account, -- for positions starting from zero. (Read-only) -- * `control_char_symbol` [number]: The way control characters are displayed. --- If less than 32, keep the rounded rectangle as ASCII mnemonics. Otherwise, --- use the given character byte. The default value is 0. +-- If less than `32`, keep the rounded rectangle as ASCII mnemonics. +-- Otherwise, use the given character byte. The default value is `0`. -- * `current_pos` [number]: The position of the caret. When setting, the caret -- is not scrolled into view. -- * `cursor` [number]: The cursor type.<br /> @@ -154,7 +156,7 @@ module('buffer') -- * `_SCINTILLA.constants.SC_EOL_CRLF` (0): `CRLF`. -- * `_SCINTILLA.constants.SC_EOL_CR` (1): `CR`. -- * `_SCINTILLA.constants.SC_EOL_LF` (2): `LF`. --- * `edge_colour` [number]: The color used in edge indication in 0xBBGGRR +-- * `edge_colour` [number]: The color used in edge indication in `0xBBGGRR` -- format. -- * `edge_column` [number]: The column number which text should be kept within. -- * `edge_mode` [number]: The edge highlight mode.<br /> @@ -166,7 +168,7 @@ module('buffer') -- characters after the column limit is changed to the color set by -- `buffer.edge_colour`. -- * `encoding` [string or nil]: The encoding of the file on the hard disk. It --- will be nil if the file is a binary file. +-- will be `nil` if the file is a binary file. -- * `encoding_bom` [string]: The byte-order mark of the file encoding (if any). -- * `end_at_last_line` [bool]: Whether the maximum scroll position has the last -- line at the bottom of the view. If `false`, allows scrolling one page below @@ -184,7 +186,7 @@ module('buffer') -- * `focus` [bool]: The internal focus flag. -- * `fold_expanded` [bool]: Expanded state of a header line. -- * `fold_level` [table]: Table of fold levels for lines starting from zero. --- Fold levels encodes an integer level along witth flags indicating whether +-- Fold levels encodes an integer level along with flags indicating whether -- the line is a header and whether it is effectively white space.<br /> -- * `_SCINTILLA.constants.SC_FOLDLEVELBASE` (0x400): Initial fold level. -- * `_SCINTILLA.constants.SC_FOLDLEVELWHITEFLAG` (0x1000): Indicates that @@ -202,12 +204,12 @@ module('buffer') -- `false` to never see it and `true` to enable it again. The default state is -- to display it when needed. -- * `highlight_guide` [number]: The highlighted indentation guide column. Set --- to 0 to cancel this highlight. +-- to `0` to cancel this highlight. -- * `hotspot_active_underline` [bool]: Whether active hotspots are underlined. -- * `hotspot_single_line` [bool]: Whether hotspots are limited to single line --- so hotspots on two lines don't merge. +-- so hotspots on two lines do not merge. -- * `indent` [number]: Ihe number of spaces used for one level of indentation. --- For a width of 0, the indent size is the same as the tab size. +-- For a width of `0`, the indent size is the same as the tab size. -- * `indentation_guides` [number]: Indentation guides appearance. -- Indentation guides are dotted vertical lines that appear within indentation -- white space every indent size columns. @@ -224,17 +226,17 @@ module('buffer') -- shown beyond the actual indentation up to the level of the next -- non-empty line or previous non-empty line whichever is the greater. -- This setting is good for most languages. --- * `indic_alpha` [table]: Table of alpha transparency values ranging from 0 --- (transparent) to 255 (opaque) or 256 (no alpha) for indicators from 0 to --- 31. Used for drawing the fill color of the `INDIC_ROUNDBOX` and +-- * `indic_alpha` [table]: Table of alpha transparency values ranging from `0` +-- (transparent) to `255` (opaque) or `256` (no alpha) for indicators from `0` +-- to `31`. Used for drawing the fill color of the `INDIC_ROUNDBOX` and -- `INDIC_STRAIGHTBOX` rectangle. --- * `indic_fore` [table]: Table of foreground colors in 0xBBGGRR format for --- indicators from zero to 31. +-- * `indic_fore` [table]: Table of foreground colors in `0xBBGGRR` format for +-- indicators from `0` to `31`. -- * `indic_outline_alpha` [table]: Table of alpha transparency values ranging --- from 0 (transparent) to 255 (opaque) or 256 (no alpha) for indicators from --- 0 to 31. Used for drawing the outline color of the `INDIC_ROUNDBOX` and --- `INDIC_STRAIGHTBOX` rectangle. --- * `indic_style` [table]: Table of styles for indicators from zero to 31. +-- from `0` (transparent) to `255` (opaque) or `256` (no alpha) for indicators +-- from `0` to `31`. Used for drawing the outline color of the +-- `INDIC_ROUNDBOX` and `INDIC_STRAIGHTBOX` rectangle. +-- * `indic_style` [table]: Table of styles for indicators from `0` to `31`. -- <br /> -- * `_SCINTILLA.constants.INDIC_PLAIN` (0): Underlined with a single, -- straight line. @@ -250,13 +252,13 @@ module('buffer') -- corners around the text using translucent drawing with the interior -- usually more transparent than the border. Use `buffer.indic_alpha` -- and `buffer.indic_outline_alpha` to control the alpha transparency --- values. The default alpha values are 30 for fill color and 50 for +-- values. The default alpha values are `30` for fill color and `50` for -- outline color. -- * `_SCINTILLA.constants.INDIC_STRAIGHTBOX` (8): A rectangle around the -- text using translucent drawing with the interior usually more -- transparent than the border. You can use `buffer.indic_alpha` and -- `buffer.indic_outline_alpha` to control the alpha transparency --- values. The default alpha values are 30 for fill color and 50 for +-- values. The default alpha values are `30` for fill color and `50` for -- outline color. -- * `_SCINTILLA.constants.INDIC_DASH` (9): A dashed underline. -- * `_SCINTILLA.constants.INDIC_DOTS` (10): A dotted underline. @@ -268,14 +270,15 @@ module('buffer') -- the alpha and outline alpha settings with the top-left pixel using -- the alpha setting. `buffer.indic_alpha` and -- `buffer.indic_outline_alpha` control the alpha transparency values. --- The default values are 30 for alpha and 50 for outline alpha. To +-- The default values are `30` for alpha and `50` for outline alpha. To -- avoid excessive memory allocation the maximum width of a dotted box -- is 4000 pixels. -- * Use `_SCINTILLA.next_indic_number()` for custom indicators. -- * `indic_under` [table]: Table of booleans for drawing under text or over --- (default) for indicators from zero to 31. --- * `indicator_current` [number]: The indicator in the range of 0 to 31 used --- for `buffer:indicator_fill_range()` and `buffer:indicator_clear_range()`. +-- (default) for indicators from `0` to `31`. +-- * `indicator_current` [number]: The indicator in the range of `0` to `31` +-- used for `buffer:indicator_fill_range()` and +-- `buffer:indicator_clear_range()`. -- * `indicator_value` [number]: The indicator value used for -- `buffer:indicator_fill_range()`. Currently all values are drawn the same. -- * `keys_unicode` [bool]: Interpret keyboard input as Unicode. @@ -333,8 +336,8 @@ module('buffer') -- * `margin_style_offset` [number]: The start of the range of style numbers -- used for margin text. Margin styles may be completely separated from -- standard text styles by setting a style offset. For example, setting this --- to 256 would allow the margin styles to be numbered from 256 upto 511 so --- they do not overlap styles set by lexers. Each style number set with +-- to `256` would allow the margin styles to be numbered from `256` upto `511` +-- so they do not overlap styles set by lexers. Each style number set with -- `buffer.margin_style` has the offset added before looking up the style. -- * `margin_type_n` [table]: Table of margin types for margins from zero to -- four.<br /> @@ -399,7 +402,7 @@ module('buffer') -- * `property` [table]: Table of keyword:value string pairs used by a lexer for -- some optional features. (Write-only) -- * `property_int` [table]: Interprets `buffer.property[keyword]` as an integer --- if found or returns 0. (Read-only) +-- if found or returns `0`. (Read-only) -- * `read_only` [bool]: Read-only mode. -- * `rectangular_selection_anchor` [number]: The position of the anchor of the -- rectangular selection. @@ -421,7 +424,7 @@ module('buffer') -- * `scroll_width` [number]: The document width assumed for scrolling. For -- performance, the view does not measure the display width of the document to -- determine the properties of the horizontal scroll bar. Instead, an assumed --- width is used. The default value is 2000. To ensure the width of the +-- width is used. The default value is `2000`. To ensure the width of the -- currently visible lines can be scrolled use `buffer.scroll_width_tracking`. -- * `scroll_width_tracking` [bool]: Whether the maximum width line displayed is -- used to set scroll width. @@ -438,8 +441,8 @@ module('buffer') -- * `_SCINTILLA.constants.SCFIND_POSIX` (0x00400000): Treat regular -- expression in a more POSIX compatible manner by interpreting bare `(` -- and `)` for tagged sections rather than `\(` and `\)`. --- * `sel_alpha` [number]: The alpha of the selection, between 0 (transparent) --- and 255 (opaque), or 256 for no alpha. +-- * `sel_alpha` [number]: The alpha of the selection, between `0` (transparent) +-- and `255` (opaque), or `256` for no alpha. -- * `sel_eol_filled` [bool]: The selection end of line fill. The selection can -- be drawn up to the right hand border by setting this property. -- * `selection_end` [number]: The position that ends the selection - this @@ -461,7 +464,7 @@ module('buffer') -- * `selection_n_caret_virtual_space` [table]: Table of the amount of virtual -- space for carets for existing selections starting from zero, the main -- selection. --- * `selection_n_end` [table]: Table of positions that end selections for +-- * `selection_n_end` [table]: Table of positions that end selections for -- existing selections starting from zero, the main selection. -- * `selection_n_start` [table]: Table of positions that start selections for -- existing selections starting from zero, the main selection. @@ -475,35 +478,36 @@ module('buffer') -- * `_SCINTILLA.constants.SC_STATUS_BADALLOC` (2): Memory is exhausted. -- * `style_at` [table]: Table of style bytes at positions in the document -- starting at zero. (Read-only) --- * `style_back` [table]: Table of background colors in 0xBBGGRR format for --- styles from zero to 255. +-- * `style_back` [table]: Table of background colors in `0xBBGGRR` format for +-- styles from `0` to `255`. -- * `style_bits` [number]: The number of bits in style bytes used to hold the -- lexical state. -- * `style_bits_needed` [number]: The number of bits the current lexer needs -- for styling. (Read-only) --- * `style_bold` [table]: Table of booleans for bold styles from zero to 255. --- * `style_case` [table]: Table of cases for styles from zero to 255.<br /> +-- * `style_bold` [table]: Table of booleans for bold styles from `0` to `255`. +-- * `style_case` [table]: Table of cases for styles from `0` to `255`.<br /> -- * `_SCINTILLA.constants.SC_CASE_MIXED` (0): Normal, mixed case. -- * `_SCINTILLA.constants.SC_CASE_UPPER` (1): Upper case. -- * `_SCINTILLA.constants.SC_CASE_LOWER` (2): Lower case. -- * `style_changeable` [table]: Table of booleans for changeable styles from --- zero to 255. The default setting is `true`. --- * `style_character_set` [table]: Table of character sets for styles from zero --- to 255. +-- `0` to `255`. The default setting is `true`. +-- * `style_character_set` [table]: Table of character sets for styles from `0` +-- to `255`. -- * `style_eol_filled` [table]: Table of booleans for end of line filled styles --- from zero to 255. +-- from `0` to `255`. -- of line is filled. --- * `style_font` [table]: Table of font faces for styles from zero to 255. --- * `style_fore` [table]: Table of foreground colors in 0xBBGGRR format for --- styles from zero to 255. --- * `style_hot_spot` [table]: Table of boolean hotspot styles from zero to 255. --- * `style_italic` [table]: Table of booleans for italic styles from zero to --- 255. --- * `style_size` [table]: Table of font sizes for styles from zero to 255. --- * `style_underline` [table]: Table of booleans for underlined styles from --- zero to 255. --- * `style_visible` [table]: Table of booleans for visible styles from zero to --- 255. +-- * `style_font` [table]: Table of font faces for styles from `0` to `255`. +-- * `style_fore` [table]: Table of foreground colors in `0xBBGGRR` format for +-- styles from `0` to `255`. +-- * `style_hot_spot` [table]: Table of boolean hotspot styles from `0` to +-- `255`. +-- * `style_italic` [table]: Table of booleans for italic styles from `0` to +-- `255`. +-- * `style_size` [table]: Table of font sizes for styles from `0` to `255`. +-- * `style_underline` [table]: Table of booleans for underlined styles from `0` +-- to `255`. +-- * `style_visible` [table]: Table of booleans for visible styles from `0` to +-- `255`. -- * `tab_indents` [bool]: Whether a tab pressed when caret is within -- indentation indents. -- * `tab_width` [number]: The visible size of a tab as a multiple of the width @@ -584,7 +588,7 @@ module('buffer') -- flag at end of subline drawn near text. -- * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_START_BY_TEXT` (2): Visual -- flag at beginning of subline drawn near text. --- * `x_offset` [number]: The horizontal scroll position. A value of 0 is the +-- * `x_offset` [number]: The horizontal scroll position. A value of `0` is the -- normal position with the first text column visible at the left of the view. -- * `zoom` [number]: The number of points added to the size of all fonts. It -- may be positive to magnify or negative to reduce. @@ -653,7 +657,7 @@ function buffer.auto_c_active(buffer) end --- -- Remove the auto-completion list from the screen. -- A set of characters that will cancel autocompletion can be specified with --- buffer:auto_c_stops(). +-- `buffer:auto_c_stops()`. -- @param buffer The global buffer. function buffer.auto_c_cancel(buffer) end @@ -685,7 +689,7 @@ function buffer.auto_c_pos_start(buffer) end --- -- Select the item in the auto-completion list that starts with a string. -- By default, comparisons are case sensitive, but this can change with --- buffer.auto_c_ignore_case. +-- `buffer.auto_c_ignore_case`. -- @param buffer The global buffer. -- @param string function buffer.auto_c_select(buffer, string) end @@ -748,8 +752,8 @@ function buffer.brace_highlight(buffer, pos1, pos2) end function buffer.brace_highlight_indicator(buffer, use_indicator, indic_num) end --- --- Find the position of a matching brace or -1 if no match. --- The brace characters handled are '(', ')', '[', ']', '{', '}', '<', and '>'. +-- Find the position of a matching brace or `-1` if no match. +-- The brace characters handled are `(`, `)`, `[`, `]`, `{`, `}`, `<`, and `>`. -- The search is forwards from an opening brace and backwards from a closing -- brace. A match only occurs if the style of the matching brace is the same as -- the starting brace or the matching brace is beyond the end of styling. Nested @@ -790,7 +794,7 @@ function buffer.call_tip_set_hlt(buffer, start_pos, end_pos) end -- The call tip text is aligned to start 1 line below this character unless up -- and/or down arrows have been included in the call tip text in which case the -- tip is aligned to the right-hand edge of the rightmost arrow. The assumption --- is that the text starts with something like "\001 1 of 3 \002". +-- is that the text starts with something like `"\001 1 of 3 \002"`. -- @param buffer The global buffer. -- @param pos The position. -- @param text The text. @@ -853,7 +857,7 @@ function buffer.char_position_from_point(buffer, x, y) end --- -- Find the position of a character from a point within the window. --- Return -1 if not close to text. +-- Return `-1` if not close to text. -- @param buffer The global buffer. -- @param x -- @param y @@ -901,7 +905,7 @@ function buffer.clear_all(buffer) end function buffer.clear_all_cmd_keys(buffer) end --- --- Set all style bytes to 0, remove all folding information. +-- Set all style bytes to `0`, remove all folding information. -- @param buffer The global buffer. function buffer.clear_document_style(buffer) end @@ -916,17 +920,17 @@ function buffer.clear_registered_images(buffer) end function buffer.clear_selections(buffer) end --- --- colorise a segment of the document using the current lexing language. +-- Colorise a segment of the document using the current lexing language. -- @param buffer The global buffer. -- @param start_pos The start position. --- @param end_pos The end position or -1 to style from start_pos to the end of --- the document. +-- @param end_pos The end position or `-1` to style from `start_pos` to the end +-- of the document. function buffer.colourise(buffer, start_pos, end_pos) end --- -- Find the next line at or after line_start that is a contracted fold header -- line. --- Return -1 when no more lines. +-- Return `-1` when no more lines. -- @param buffer The global buffer. -- @param line_start The start line number. -- @return number @@ -936,9 +940,9 @@ function buffer.contracted_fold_next(buffer, line_start) end -- Converts all line endings in the document to one mode. -- @param buffer The global buffer. -- @param mode The line ending mode. Valid values are: --- _SCINTILLA.constants.SC_EOL_CRLF (0), --- _SCINTILLA.constants.SC_EOL_CR (1), or --- _SCINTILLA.constants.SC_EOL_LF (2). +-- `_SCINTILLA.constants.SC_EOL_CRLF` (0), +-- `_SCINTILLA.constants.SC_EOL_CR (1)`, or +-- `_SCINTILLA.constants.SC_EOL_LF (2)`. function buffer.convert_eo_ls(buffer, mode) end --- @@ -1048,7 +1052,7 @@ function buffer.empty_undo_buffer(buffer) end --- -- Translates a UTF8 string into the document encoding. --- Return the length of the result in bytes. On error return 0. +-- Return the length of the result in bytes. On error return `0`. -- @param buffer The global buffer. -- @param string The string. -- @return number @@ -1109,7 +1113,7 @@ function buffer.get_hotspot_active_fore(buffer) end -- Find the last child line of a header line. -- @param buffer The global buffer. -- @param header_line The line number of a header line. --- @param level The level or -1 for the level of header_line. +-- @param level The level or `-1` for the level of header_line. function buffer.get_last_child(buffer, header_line, level) end --- @@ -1126,28 +1130,28 @@ function buffer.get_lexer_language(buffer) end function buffer.get_line(buffer, line) end --- --- Retrieve the position of the end of the selection at the given line (-1 if no --- selection on this line). +-- Retrieve the position of the end of the selection at the given line (`-1` if +-- no selection on this line). -- @param buffer The global buffer. -- @param line The line number. function buffer.get_line_sel_end_position(buffer, line) end --- --- Retrieve the position of the start of the selection at the given line (-1 if --- no selection on this line). +-- Retrieve the position of the start of the selection at the given line (`-1` +-- if no selection on this line). -- @param buffer The global buffer. -- @param line The line number. function buffer.get_line_sel_start_position(buffer, line) end --- --- Retrieve a "property" value previously set with `buffer.property`. +-- Retrieve a `property` value previously set with `buffer.property`. -- @param buffer The global buffer. -- @param key Keyword. -- @return string function buffer.get_property(buffer, key) end --- --- Retrieve a "property" value previously set with `buffer.property`, with "$()" +-- Retrieve a `property` value previously set with `buffer.property`, with `$()` -- variable replacement on returned buffer. -- @param buffer The global buffer. -- @param key Keyword. @@ -1194,7 +1198,7 @@ function buffer.grab_focus(buffer) end --- -- Make a range of lines invisible. --- This has no effect on fold levels or fold flags. start_line can not be +-- This has no effect on fold levels or fold flags. `start_line` can not be -- hidden. -- @param buffer The global buffer. -- @param start_line The start line. @@ -1265,7 +1269,7 @@ function buffer.indicator_clear_range(buffer, pos, clear_length) end --- -- Find the position where a particular indicator ends. -- @param buffer The global buffer. --- @param indicator An indicator number in the range of 0 to 31. +-- @param indicator An indicator number in the range of `0` to `31`. -- @param pos The position of the indicator. function buffer.indicator_end(buffer, indicator, pos) end @@ -1280,7 +1284,7 @@ function buffer.indicator_fill_range(buffer, pos, fill_length) end --- -- Find the position where a particular indicator starts. -- @param buffer The global buffer. --- @param indicator An indicator number in the range of 0 to 31. +-- @param indicator An indicator number in the range of `0` to `31`. -- @param pos The position of the indicator. function buffer.indicator_start(buffer, indicator, pos) end @@ -1288,7 +1292,7 @@ function buffer.indicator_start(buffer, indicator, pos) end -- Retrieve the value of a particular indicator at a position. -- Currently all values are drawn the same. -- @param buffer The global buffer. --- @param indicator The indicator number in the range of 0 to 31. +-- @param indicator The indicator number in the range of `0` to `31`. -- @param pos The position. -- @return number function buffer.indicator_value_at(buffer, indicator, pos) end @@ -1298,7 +1302,7 @@ function buffer.indicator_value_at(buffer, indicator, pos) end -- If the current position is after the insertion point then it is moved along -- with its surrounding text but no scrolling is performed. -- @param buffer The global buffer. --- @param pos The position to insert text at or -1 for the current position. +-- @param pos The position to insert text at or `-1` for the current position. -- @param text The text to insert. function buffer.insert_text(buffer, pos, text) end @@ -1438,10 +1442,10 @@ function buffer.line_up_rect_extend(buffer) end function buffer.lines_join(buffer) end --- --- Split the lines in the target into lines that are less wide than pixel_width --- where possible. +-- Split the lines in the target into lines that are less wide than +-- `pixel_width` where possible. -- @param buffer The global buffer. --- @param pixel_width The pixel width. When 0, the width of the view is used. +-- @param pixel_width The pixel width. When `0`, the width of the view is used. function buffer.lines_split(buffer, pixel_width) end --- @@ -1471,10 +1475,10 @@ function buffer.margin_text_clear_all(buffer) end --- -- Add a marker to a line, returning an ID which can be used to find or delete -- the marker. --- Returns -1 if this fails (illegal line number, out of memory). +-- Returns `-1` if this fails (illegal line number, out of memory). -- @param buffer The global buffer. -- @param line The line number. --- @param marker_num A marker number in the range of 0 to 31. +-- @param marker_num A marker number in the range of `0` to `31`. -- @return number function buffer.marker_add(buffer, line, marker_num) end @@ -1489,16 +1493,16 @@ function buffer.marker_add_set(buffer, line, marker_mask) end --- -- Set the symbol used for a particular marker number. -- @param buffer The global buffer. --- @param marker_num A marker number in the range of 0 to 31. --- @param marker_symbol A marker symbol: _SCINTILLA.constants.SC_MARK_*. +-- @param marker_num A marker number in the range of `0` to `31`. +-- @param marker_symbol A marker symbol: `_SCINTILLA.constants.SC_MARK_*`. -- @see _SCINTILLA.next_marker_number function buffer.marker_define(buffer, marker_num, marker_symbol) end --- -- Define a marker from a pixmap. -- @param buffer The global buffer. --- @param marker_num A marker number in the range of 0 to 31. --- @param pixmap Null-terminated pixmap data. +-- @param marker_num A marker number in the range of `0` to `31`. +-- @param pixmap `NULL`-terminated pixmap data. function buffer.marker_define_pixmap(buffer, marker_num, pixmap) end --- @@ -1506,35 +1510,35 @@ function buffer.marker_define_pixmap(buffer, marker_num, pixmap) end -- It has the width and height from `buffer.rgba_image_width` and -- `buffer.rgba_image_height`. -- @param buffer The global buffer. --- @param marker_num A marker number in the range of 0 to 31. +-- @param marker_num A marker number in the range of `0` to `31`. -- @param pixels A sequence of 4 byte pixel values starting with the pixels for -- the top line, with the leftmost pixel first, then continuing with the -- pixels for subsequent lines. There is no gap between lines for alignment -- reasons. Each pixel consists of, in order, a red byte, a green byte, a blue -- byte and an alpha byte. The colour bytes are not premultiplied by the alpha --- value. That is, a fully red pixel that is 25% opaque will be [FF, 00, 00, --- 3F]. +-- value. That is, a fully red pixel that is 25% opaque will be `[FF, 00, 00, +-- 3F]`. function buffer.marker_define_rgba_image(buffer, marker_num, pixels) end --- -- Delete a marker from a line. -- @param buffer The global buffer. -- @param line The line number. --- @param marker_num A marker number in the range of 0 to 31 or -1 to delete all --- markers from the line. +-- @param marker_num A marker number in the range of `0` to `31` or `-1` to +-- delete all markers from the line. function buffer.marker_delete(buffer, line, marker_num) end --- -- Delete all markers with a particular number from all lines. -- @param buffer The global buffer. --- @param marker_num A marker number in the range of 0 to 31 or -1 to delete all --- markers from all lines. +-- @param marker_num A marker number in the range of `0` to `31` or `-1` to +-- delete all markers from the line. function buffer.marker_delete_all(buffer, marker_num) end --- -- Delete a marker. -- @param buffer The global buffer. --- @param handle The identifier of a marker returned by buffer:marker_add(). +-- @param handle The identifier of a marker returned by `buffer:marker_add()`. function buffer.marker_delete_handle(buffer, handle) end --- @@ -1554,15 +1558,15 @@ function buffer.marker_get(buffer, line) end --- -- Retrieve the line number at which a particular marker is located. --- Returns -1 if it not found. +-- Returns `-1` if it not found. -- @param buffer The global buffer. --- @param handle The identifier of a marker returned by buffer:marker_add(). +-- @param handle The identifier of a marker returned by `buffer:marker_add()`. -- @return number function buffer.marker_line_from_handle(buffer, handle) end --- -- Find the next line at or after start_line that includes a marker in mask. --- Return -1 when no more lines. +-- Return `-1` when no more lines. -- @param buffer The global buffer. -- @param start_line The start line. -- @param marker_mask A mask of markers to find. Set bit 0 to find marker 0, bit @@ -1571,7 +1575,7 @@ function buffer.marker_line_from_handle(buffer, handle) end function buffer.marker_next(buffer, start_line, marker_mask) end --- --- Find the previous line before lineStart that includes a marker in mask. +-- Find the previous line before `start_line` that includes a marker in mask. -- @param buffer The global buffer. -- @param start_line The start line. -- @param marker_mask A mask of markers to find. Set bit 0 to find marker 0, bit @@ -1583,42 +1587,42 @@ function buffer.marker_previous(buffer, start_line, marker_mask) end -- Set the alpha used for a marker that is drawn in the text area, not the -- margin. -- @param buffer The global buffer. --- @param marker_num A marker number in the range of 0 to 31. --- @param alpha An alpha value between 0 (transparent) and 255 (opaque), or 256 --- for no alpha. +-- @param marker_num A marker number in the range of `0` to `31`. +-- @param alpha An alpha value between `0` (transparent) and `255` (opaque), or +-- `256` for no alpha. function buffer.marker_set_alpha(buffer, marker_num, alpha) end --- -- Set the background color used for a particular marker number. -- @param buffer The global buffer. --- @param marker_num A marker number in the range of 0 to 31. --- @param color A color in 0xBBGGRR format. +-- @param marker_num A marker number in the range of `0` to `31`. +-- @param color A color in `0xBBGGRR` format. function buffer.marker_set_back(buffer, marker_num, color) end --- -- Set the background color used for a particular marker number when its -- folding block is selected. -- @param buffer The global buffer. --- @param marker_num A marker number in the range of 0 to 31. --- @param color A color in 0xBBGGRR format. The default color is #FF0000. +-- @param marker_num A marker number in the range of `0` to `31`. +-- @param color A color in `0xBBGGRR` format. The default color is `#FF0000`. function buffer.marker_set_back_selected(buffer, marker_num, color) end --- -- Set the foreground color used for a particular marker number. -- @param buffer The global buffer. --- @param marker_num A marker number in the range of 0 to 31. --- @param color A color in 0xBBGGRR format. +-- @param marker_num A marker number in the range of `0` to `31`. +-- @param color A color in `0xBBGGRR` format. function buffer.marker_set_fore(buffer, marker_num, color) end --- -- Return the symbol defined for marker_num with `buffer:marker_define()`. -- @param buffer The global buffer. --- @param marker_num A marker number in the range of 0 to 31. +-- @param marker_num A marker number in the range of `0` to `31`. -- @return number function buffer.marker_symbol_defined(buffer, marker_num) end --- --- Move the caret inside current view if it's not there already. +-- Move the caret inside current view if it is not there already. -- Any selection is lost. -- @param buffer The global buffer. function buffer.move_caret_inside_view(buffer) end @@ -1738,7 +1742,7 @@ function buffer.position_after(buffer, pos) end --- -- Given a valid document position, return the previous position taking code --- page into account. Returns 0 if passed 0. +-- page into account. Returns `0` if passed `0`. -- @param buffer The global buffer. -- @param pos The position. -- @return number @@ -1746,7 +1750,7 @@ function buffer.position_before(buffer, pos) end --- -- Retrieve the position at the start of a line. --- If line is greater than the lines in the document, returns -1. +-- If line is greater than the lines in the document, returns `-1`. -- @param buffer The global buffer. -- @param line The line. -- @return number @@ -1761,7 +1765,7 @@ function buffer.position_from_line(buffer, line) end function buffer.position_from_point(buffer, x, y) end --- --- Returns the position from a point within the window, but return -1 if not +-- Returns the position from a point within the window, but return `-1` if not -- close to text. -- @param buffer The global buffer. -- @param x @@ -1778,7 +1782,7 @@ function buffer.redo(buffer) end -- Register an XPM image for use in autocompletion lists. -- @param buffer The global buffer. -- @param type Integer type to register the image with. --- @param xpm_data XPM data as is described for buffer:marker_define_pixmap(). +-- @param xpm_data XPM data as is described for `buffer:marker_define_pixmap()`. function buffer.register_image(buffer, type, xpm_data) end --- @@ -1788,7 +1792,7 @@ function buffer.register_image(buffer, type, xpm_data) end -- @param buffer The global buffer. -- @param type Integer type to register the image with. -- @param pixels RGBA data as is described for --- buffer:marker_define_rgba_image(). +-- `buffer:marker_define_rgba_image()`. function buffer.register_rgba_image(buffer, type, pixels) end --- @@ -1809,11 +1813,11 @@ function buffer.replace_sel(buffer, text) end function buffer.replace_target(buffer, text) end --- --- Replace the target text with the argument text after \d processing. --- Looks for \d where d is between 1 and 9 and replaces these with the strings --- matched in the last search operation which were surrounded by \( and \). --- Returns the length of the replacement text including any change caused by --- processing the \d patterns. +-- Replace the target text with the argument text after `\d` processing. +-- Looks for `\d` where `d` is between `1` and `9` and replaces these with the +-- strings matched in the last search operation which were surrounded by `\(` +-- and `\)`. Returns the length of the replacement text including any change +-- caused by processing the `\d` patterns. -- @param buffer The global buffer. -- @param text The text (can contain NULs). -- @return number @@ -1849,7 +1853,8 @@ function buffer.search_anchor(buffer) end --- -- Search for a counted string in the target and set the target to the found -- range. --- Returns length of range or -1 for failure in which case target is not moved. +-- Returns length of range or `-1` for failure in which case target is not +-- moved. -- @param buffer The global buffer. -- @param text The text (can contain NULs). -- @return number @@ -1857,8 +1862,8 @@ function buffer.search_in_target(buffer, text) end --- -- Find some text starting at the search anchor. --- The return value is -1 if nothing is found, otherwise the return value is the --- start position of the matching text. The selection is updated to show the +-- The return value is `-1` if nothing is found, otherwise the return value is +-- the start position of the matching text. The selection is updated to show the -- matched text, but is not scrolled into view. -- @param buffer The global buffer. -- @param flags Search flags. See `buffer.search_flags`. @@ -1868,8 +1873,8 @@ function buffer.search_next(buffer, flags, text) end --- -- Find some text starting at the search anchor and moving backwards. --- The return value is -1 if nothing is found, otherwise the return value is the --- start position of the matching text. The selection is updated to show the +-- The return value is `-1` if nothing is found, otherwise the return value is +-- the start position of the matching text. The selection is updated to show the -- matched text, but is not scrolled into view. -- @param buffer The global buffer. -- @param flags Search flags. See `buffer.search_flags`. @@ -1893,7 +1898,7 @@ function buffer.selection_duplicate(buffer) end -- Reset the set of characters for whitespace and word characters to the -- defaults. -- This sets whitespace to space, tab and other characters with codes less than --- 0x20, with word characters set to alphanumeric and '_'. +-- `0x20`, with word characters set to alphanumeric and `'_'`. -- @param buffer The global buffer. function buffer.set_chars_default(buffer) end @@ -1920,34 +1925,34 @@ function buffer.set_fold_flags(buffer, flags) end -- Set the colors used as a chequerboard pattern in the fold margin. -- @param buffer The global buffer. -- @param use_setting Enable color change. --- @param color A color in 0xBBGGRR format. +-- @param color A color in `0xBBGGRR` format. function buffer.set_fold_margin_colour(buffer, use_setting, color) end --- --- Set the colors used as a chequerboard pattern in the fold margin. +-- Set the colors used as a checkerboard pattern in the fold margin. -- @param buffer The global buffer. -- @param use_setting Enable color change. --- @param color A color in 0xBBGGRR format. +-- @param color A color in `0xBBGGRR` format. function buffer.set_fold_margin_hi_colour(buffer, use_setting, color) end --- -- Set a back color for active hotspots. -- @param buffer The global buffer. -- @param use_setting Enable the color change. --- @param color A color in 0xBBGGRR format. +-- @param color A color in `0xBBGGRR` format. function buffer.set_hotspot_active_back(buffer, use_setting, color) end --- -- Set a fore color for active hotspots. -- @param buffer The global buffer. -- @param use_setting Enable the color change. --- @param color A color in 0xBBGGRR format. +-- @param color A color in `0xBBGGRR` format. function buffer.set_hotspot_active_fore(buffer, use_setting, color) end --- -- Set the length of the utf8 argument for calling `buffer:encoded_from_utf8()`. -- @param buffer The global buffer. --- @param bytes Bytes or -1 for measuring to first nul. +-- @param bytes Bytes or `-1` for measuring to first NUL. function buffer.set_length_for_encode(buffer, bytes) end --- @@ -1969,7 +1974,7 @@ function buffer.set_save_point(buffer) end -- @param start_pos Start position. If negative, it means the end of the -- document. -- @param end_pos End position. If negative, it means remove any selection (i.e. --- set the anchor to the same position as current_pos). +-- set the `anchor` to the same position as `current_pos`). function buffer.set_sel(buffer, start_pos, end_pos) end --- @@ -1977,7 +1982,7 @@ function buffer.set_sel(buffer, start_pos, end_pos) end -- use this setting. -- @param buffer The global buffer. -- @param use_setting Enable color change. --- @param color A color in 0xBBGGRR format. +-- @param color A color in `0xBBGGRR` format. function buffer.set_sel_back(buffer, use_setting, color) end --- @@ -1985,7 +1990,7 @@ function buffer.set_sel_back(buffer, use_setting, color) end -- to use this setting. -- @param buffer The global buffer. -- @param use_setting Enable color change. --- @param color A color in 0xBBGGRR format. +-- @param color A color in `0xBBGGRR` format. function buffer.set_sel_fore(buffer, use_setting, color) end --- @@ -2023,14 +2028,14 @@ function buffer.set_visible_policy(buffer, visible_policy, visible_slop) end -- Set the background color of all whitespace and whether to use this setting. -- @param buffer The global buffer. -- @param use_setting Enable color change. --- @param color A color in 0xBBGGRR format. +-- @param color A color in `0xBBGGRR` format. function buffer.set_whitespace_back(buffer, use_setting, color) end --- -- Set the foreground color of all whitespace and whether to use this setting. -- @param buffer The global buffer. -- @param use_setting Enable color change. --- @param color A color in 0xBBGGRR format. +-- @param color A color in `0xBBGGRR` format. function buffer.set_whitespace_fore(buffer, use_setting, color) end --- @@ -2056,7 +2061,7 @@ function buffer.set_y_caret_policy(buffer, caret_policy, caret_slop) end --- -- Make a range of lines visible. --- This has no effect on fold levels or fold flags. start_line can not be +-- This has no effect on fold levels or fold flags. `start_line` can not be -- hidden. -- @param buffer The global buffer. -- @param start_line The start line. @@ -2154,7 +2159,7 @@ function buffer.text_height(buffer, line) end -- Measure the pixel width of some text in a particular style. -- Does not handle tab or control characters. -- @param buffer The global buffer. --- @param style_num The style number. +-- @param style_num The style number between `0` and `255`. -- @param text The text. -- @return number function buffer.text_width(buffer, style_num, text) end @@ -2235,7 +2240,7 @@ function buffer.vertical_centre_caret(buffer) end --- -- Find the display line of a document line taking hidden lines into account. -- If there is folding and line is outside the range of lines in the document, --- the return value is -1. +-- the return value is `-1`. -- @param buffer The global buffer. -- @param line The line number. -- @return number @@ -2352,16 +2357,15 @@ function buffer.zoom_out(buffer) end -- Checks whether the given buffer is the global one. -- If not, throws an error indicating so. It is necessary to call this at the -- top of all buffer functions to avoid unexpected behavior since most buffer --- functions operate on the global 'buffer', which is not necessarily the given --- one. +-- functions operate on `_G.buffer`, which is not necessarily the given one. -- @param buffer The buffer to check. function buffer.check_global(buffer) end --- -- Deletes the current buffer. --- WARNING: this function should NOT be called via scripts. io provides a --- close() function for buffers to prompt for confirmation if necessary; this --- function does not. Activates the 'buffer_deleted' signal. +-- WARNING: this function should NOT be called via scripts. `_G.io` provides a +-- `close()` function for buffers to prompt for confirmation if necessary; this +-- function does not. Genrates a `BUFFER_DELETED` event. -- @param buffer The global buffer. function buffer.delete(buffer) end @@ -2381,7 +2385,7 @@ function buffer.reload(buffer) end -- Sets the encoding for the buffer, converting its contents in the process. -- @param buffer The global buffer. -- @param encoding The encoding to set. Valid encodings are ones that GTK's --- g_convert() function accepts (typically GNU iconv's encodings). +-- `g_convert()` function accepts (typically GNU iconv's encodings). -- @usage buffer.set_encoding(buffer, 'ASCII') function buffer.set_encoding(buffer) end @@ -2405,8 +2409,8 @@ function buffer.save_as(buffer) end function buffer.close(buffer) end --- --- Replacement for buffer.set_lexer_language(buffer). --- Sets a buffer._lexer field so it can be restored without querying the +-- Replacement for `buffer.set_lexer_language(buffer)`. +-- 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. -- Loads the language-specific module if it exists. @@ -2416,14 +2420,14 @@ function buffer.close(buffer) end function buffer.set_lexer(buffer, lang) end --- --- Replacement for buffer.get_lexer_language(buffer). +-- Replacement for `buffer.get_lexer_language(buffer)`. -- @param buffer The global buffer. function buffer.get_lexer(buffer) end --- -- Returns the name of the style associated with a style number. -- @param buffer The global buffer. --- @param style_num A style number in the range 0 <= style_num < 256. +-- @param style_num A style number from `0` to `255`. -- @see buffer.style_at function buffer.get_style_name(buffer, style_num) end diff --git a/core/.command_entry.luadoc b/core/.command_entry.luadoc index 03c52eb0..3dbab4ba 100644 --- a/core/.command_entry.luadoc +++ b/core/.command_entry.luadoc @@ -11,5 +11,6 @@ module('gui.command_entry') -- -- * `entry_text` [string]: The text in the entry. ---- Focuses the command entry. +--- +-- Focuses the command entry. function focus() end diff --git a/core/.find.luadoc b/core/.find.luadoc index 7b7a474b..605cee59 100644 --- a/core/.find.luadoc +++ b/core/.find.luadoc @@ -70,7 +70,7 @@ function find_incremental() end --- -- Performs a find in files with the given directory. --- Use the gui.find fields to set the text to find and find options. +-- Use the `gui.find` fields to set the text to find and option flags. -- @param utf8_dir UTF-8 encoded directory name. If none is provided, the user -- is prompted for one. function find_in_files(utf8_dir) end diff --git a/core/.gui.luadoc b/core/.gui.luadoc index 38001ea9..2ff13019 100644 --- a/core/.gui.luadoc +++ b/core/.gui.luadoc @@ -19,7 +19,7 @@ module('gui') --- -- Goes to the specified view. --- Activates the 'view_*_switch' signal. +-- Generates `VIEW_BEFORE_SWITCH` and `VIEW_AFTER_SWITCH` events. -- @param n A relative or absolute view index. -- @param relative Flag indicating if n is a relative index or not. Defaults to -- false. @@ -28,10 +28,10 @@ function goto_view(n, relative) end --- -- Gets the current split view structure. -- @return table of split views. Each split view entry is a table with 4 --- fields: 1, 2, vertical, and size. 1 and 2 have values of either --- split view entries or the index of the buffer shown in each view. --- vertical is a flag indicating if the split is vertical or not, and --- size is the integer position of the split resizer. +-- fields: `1`, `2`, `vertical`, and `size`. `1` and `2` have values of either +-- split view entries or the index of the buffer shown in each view; +-- `vertical` is a flag indicating if the split is vertical or not; and +-- `size` is the integer position of the split resizer. function get_split_table() end --- @@ -40,11 +40,11 @@ function get_split_table() end -- with a string menu item, integer menu ID, and optional keycode and modifier -- mask. The latter two are used to display key shortcuts in the menu. The -- string menu item is handled as follows: --- 'gtk-*' - a stock menu item is created based on the GTK stock-id. --- 'separator' - a menu separator item is created. +-- `'gtk-*'` - a stock menu item is created based on the GTK stock-id. +-- `'separator'` - a menu separator item is created. -- Otherwise a regular menu item with a mnemonic is created. -- Submenus are just nested menu-structure tables. Their title text is defined --- with a 'title' key. +-- with a `title` key. -- @see keys.get_gdk_key function gtkmenu(menu_table) end @@ -62,7 +62,8 @@ function _print(buffer_type, ...) end --- -- Prints messages to the Textadept message buffer. --- Opens a new buffer (if one hasn't already been opened) for printing messages. +-- Opens a new buffer (if one has not already been opened) for printing +-- messages. -- @param ... Message strings. function print(...) end @@ -72,24 +73,24 @@ function print(...) end function switch_buffer() end --- --- Displays a CocoaDialog of a specified type with the given string arguments. --- Each argument is like a string in Lua's 'arg' table. Tables of strings are +-- Displays a gcocoadialog of a specified type with the given string arguments. +-- Each argument is like a string in Lua's `arg` table. Tables of strings are -- allowed as arguments and are expanded in place. This is useful for -- filteredlist dialogs with many items. --- @return string CocoaDialog result. +-- @return string gcocoadialog result. function dialog(kind, ...) end --- --- Shortcut function for gui.dialog('filtered_list', ...) with 'Ok' and 'Cancel' --- buttons. +-- Shortcut function for `gui.dialog('filtered_list', ...)` with 'Ok' and +-- 'Cancel' buttons. -- @param title The title for the filteredlist dialog. -- @param columns A column name or list of column names. -- @param items An item or list of items. --- @param int_return If true, returns the integer index of the selected item in --- the filteredlist. Defaults to false, which returns the string item. Not --- compatible with a '--select-multiple' filteredlist. --- @param ... Additional parameters to pass to gui.dialog(). --- @return Either a string or integer on success; nil otherwise. +-- @param int_return If `true`, returns the integer index of the selected item +-- in the filteredlist. Defaults to `false`, which returns the string item. +-- Not compatible with a `'--select-multiple'` filteredlist. +-- @param ... Additional parameters to pass to `gui.dialog()`. +-- @return Either a string or integer on success; `nil` otherwise. -- @usage gui.filteredlist('Title', 'Foo', { 'Bar', 'Baz' }) -- @usage gui.filteredlist('Title', { 'Foo', 'Bar' }, { 'a', 'b', 'c', 'd' }, -- false, '--output-column', '2') diff --git a/core/.iconv.luadoc b/core/.iconv.luadoc index ad13b686..de4084c7 100644 --- a/core/.iconv.luadoc +++ b/core/.iconv.luadoc @@ -6,8 +6,8 @@ module('string') --- --- Converts a string from one character set to another using iconv(). --- Valid character sets are ones GLib's g_convert() accepts, typically GNU +-- Converts a string from one character set to another using iconv. +-- Valid character sets are ones GLib's `g_convert()` accepts, typically GNU -- iconv's character sets. -- @param text The text to convert. -- @param to The character set to convert to. diff --git a/core/.view.luadoc b/core/.view.luadoc index 6bf1fe37..dee6a96f 100644 --- a/core/.view.luadoc +++ b/core/.view.luadoc @@ -4,7 +4,7 @@ --- -- The currently focused view. --- It also represents the structure of any view table in 'views'. +-- It also represents the structure of any view table in `_G._VIEWS`. module('view') -- Markdown: @@ -16,7 +16,7 @@ module('view') --- -- Splits the indexed view vertically or horizontally and focuses the new view. --- @param vertical Flag indicating a vertical split. Defaults to false for +-- @param vertical Flag indicating a vertical split. Defaults to `false` for -- horizontal. -- @return old view and new view tables. function view:split(vertical) end @@ -28,9 +28,9 @@ function view:unsplit() end --- -- Goes to the specified buffer in the indexed view. --- Activates the 'buffer_*_switch' signals. --- @param n A relative or absolute buffer index. An absolute index of -1 goes +-- Generates `BUFFER_BEFORE_SWITCH` and `BUFFER_AFTER_SWITCH` events. +-- @param n A relative or absolute buffer index. An absolute index of `-1` goes -- to the last buffer. --- @param relative Flag indicating if n is a relative index or not. Defaults to --- false. +-- @param relative Flag indicating if `n` is a relative index or not. Defaults +-- to `false`. function view:goto_buffer(n, relative) end diff --git a/core/args.lua b/core/args.lua index f59a52cd..ea1c9093 100644 --- a/core/args.lua +++ b/core/args.lua @@ -1,6 +1,7 @@ -- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. ---- Processes command line arguments for Textadept. +--- +-- Processes command line arguments for Textadept. module('args', package.seeall) -- Markdown: @@ -30,9 +31,9 @@ end --- -- Processes command line arguments. --- Add command line switches with args.register(). Any unrecognized arguments +-- Add command line switches with `args.register()`. Any unrecognized arguments -- are treated as filepaths and opened. --- Generates an 'arg_none' event when no args are present. +-- Generates an `'arg_none'` event when no args are present. -- @see register function process() local no_args = true @@ -71,7 +72,7 @@ if WIN32 and #arg[0] > 0 then for i = 1, #params do arg[#arg + 1] = params[i] end end --- Set _G._USERHOME. +-- Set `_G._USERHOME`. local userhome = os.getenv(not WIN32 and 'HOME' or 'USERPROFILE')..'/.textadept' for i = 1, #arg do if (arg[i] == '-u' or arg[i] == '--userhome') and arg[i + 1] then diff --git a/core/events.lua b/core/events.lua index a67dde9d..2145bee4 100644 --- a/core/events.lua +++ b/core/events.lua @@ -204,7 +204,7 @@ end --- -- Disconnects a handler function from an event. -- @param event The string event name. --- @param index Index of the handler (returned by events.connect). +-- @param index Index of the handler (returned by `events.connect()`). -- @see connect function disconnect(event, index) if not handlers[event] then return end @@ -216,11 +216,12 @@ local error_emitted = false --- -- Calls all handlers for the given event in sequence (effectively "generating" -- the event). --- If true or false is explicitly returned by any handler, the event is not +-- If `true` or `false` is explicitly returned by any handler, the event is not -- propagated any further; iteration ceases. -- @param event The string event name. -- @param ... Arguments passed to the handler. --- @return true or false if any handler explicitly returned such; nil otherwise. +-- @return `true` or `false` if any handler explicitly returned such; nil +-- otherwise. function emit(event, ...) if not event then error(L('Undefined event name')) end local h = handlers[event] diff --git a/core/file_io.lua b/core/file_io.lua index bb5f452e..2a1385bc 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -68,9 +68,9 @@ boms = { -- Attempt to detect the encoding of the given text. -- @param text Text to determine encoding from. --- @return encoding string for string.iconv() (unless 'binary', indicating a --- binary file), byte-order mark (BOM) string or nil. If encoding string is --- nil, no encoding has been detected. +-- @return encoding string for `string.iconv()` (unless `'binary'`, indicating a +-- binary file), byte-order mark (BOM) string or `nil`. If encoding string is +-- `nil`, no encoding has been detected. local function detect_encoding(text) local b1, b2, b3, b4 = string.byte(text, 1, 4) if b1 == 239 and b2 == 187 and b3 == 191 then @@ -98,8 +98,8 @@ try_encodings = { 'UTF-8', 'ASCII', 'ISO-8859-1', 'MacRoman' } --- -- Opens a list of files. --- @param utf8_filenames A '\n' separated list of UTF-8-encoded filenames to --- open. If nil, the user is prompted with a fileselect dialog. +-- @param utf8_filenames A `\n` separated list of UTF-8-encoded filenames to +-- open. If `nil`, the user is prompted with a fileselect dialog. -- @usage io.open_file(utf8_encoded_filename) function open_file(utf8_filenames) utf8_filenames = utf8_filenames or @@ -328,7 +328,7 @@ events.connect(events.BUFFER_NEW, function() buffer.encoding = 'UTF-8' end) --- Close initial 'Untitled' buffer. +-- Close initial "Untitled" buffer. events.connect(events.FILE_OPENED, function(utf8_filename) local b = _BUFFERS[1] if #_BUFFERS == 2 and not (b.filename or b._type or b.dirty) then diff --git a/core/gui.lua b/core/gui.lua index d838b4ac..6c6e60ef 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -128,20 +128,20 @@ end) connect(events.BUFFER_NEW, function() events.emit(events.UPDATE_UI) end) -- Sets the title of the Textadept window to the buffer's filename. --- @param buffer The currently focused buffer. +-- @param buffer The global buffer. local function set_title(buffer) local filename = buffer.filename or buffer._type or L('Untitled') gui.title = string.format('%s %s Textadept (%s)', filename:match('[^/\\]+$'), buffer.dirty and '*' or '-', filename) end --- Changes Textadept title to show 'clean' buffer. +-- Changes Textadept title to show the buffer as being "clean". connect(events.SAVE_POINT_REACHED, function() buffer.dirty = false set_title(buffer) end) --- Changes Textadept title to show 'dirty' buffer. +-- Changes Textadept title to show thee buffer as "dirty". connect(events.SAVE_POINT_LEFT, function() buffer.dirty = true set_title(buffer) diff --git a/core/keys.lua b/core/keys.lua index 4d438426..a7d0f3d1 100644 --- a/core/keys.lua +++ b/core/keys.lua @@ -116,8 +116,8 @@ local getmetatable = getmetatable local error = function(e) events.emit(events.ERROR, e) end --- --- Lookup table for key values higher than 255. --- If a key value given to 'keypress' is higher than 255, this table is used to +-- Lookup table for key codes higher than 255. +-- If a key code 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 @@ -149,9 +149,9 @@ local function clear_key_sequence() end -- Runs a given command. --- This is also used by menu.lua. +-- This is also used by `modules/textadept/menu.lua`. -- @param command A function or table as described above. --- @param command_type The type() of command. +-- @param command_type Equivalent to `type(command)`. -- @return the value the command returns. local function run_command(command, command_type) local f, args = command_type == 'function' and command or command[1], no_args @@ -172,7 +172,7 @@ local function run_command(command, command_type) end _M.run_command = run_command -- export for menu.lua without creating LuaDoc --- Return codes for run_key_command(). +-- Return codes for `run_key_command()`. local INVALID = -1 local PROPAGATE = 0 local CHAIN = 1 @@ -180,7 +180,7 @@ local HALT = 2 -- Runs a key command associated with the current keychain. -- @param lexer Optional lexer name for lexer-specific commands. --- @return INVALID, PROPAGATE, CHAIN, or HALT. +-- @return `INVALID`, `PROPAGATE`, `CHAIN`, or `HALT`. local function run_key_command(lexer) local key, key_type = keys, type(keys) if lexer and key_type == 'table' and key[lexer] then key = key[lexer] end @@ -204,13 +204,13 @@ end -- Handles Textadept keypresses. -- It is called every time a key is pressed, and based on lexer, executes a --- command. The command is looked up in the global 'keys' key command table. +-- command. The command is looked up in the `_G.keys` table. -- @param code The keycode. -- @param shift Whether or not the Shift modifier is pressed. -- @param control Whether or not the Control modifier is pressed. -- @param alt Whether or not the Alt/option modifier is pressed. -- @param meta Whether or not the Command modifier on Mac OSX is pressed. --- @return true to stop handling the key; nil otherwise. +-- @return `true` to stop handling the key; `nil` otherwise. local function keypress(code, shift, control, alt, meta) local buffer = buffer local key diff --git a/modules/textadept/adeptsense.lua b/modules/textadept/adeptsense.lua index 20dae39d..ee6fa1e9 100644 --- a/modules/textadept/adeptsense.lua +++ b/modules/textadept/adeptsense.lua @@ -212,7 +212,7 @@ module('_m.textadept.adeptsense', package.seeall) -- end -- end -- --- The default adeptsense functions are called by using the `self.super` +-- The default Adeptsense functions are called by using the `self.super` -- reference. -- -- ##### Examples for Ruby @@ -319,8 +319,8 @@ module('_m.textadept.adeptsense', package.seeall) -- -- ## 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 = {} @@ -330,9 +330,9 @@ FIELDS = '/* XPM */\nstatic char *field[] = {\n/* columns rows colors chars-per- --- -- Returns a full symbol (if any) and current symbol part (if any) behind the -- caret. --- For example: buffer.cur would return 'buffer' and 'cur'. --- @param sense The adeptsense returned by adeptsense.new(). --- @return symbol or '', part or ''. +-- For example: `buffer.cur` would return `'buffer'` and `'cur'`. +-- @param sense The Adeptsense returned by `adeptsense.new()`. +-- @return symbol or `''`, part or `''`. function get_symbol(sense) local line, p = buffer:get_cur_line() local sc, wc = sense.syntax.symbol_chars, sense.syntax.word_chars @@ -344,13 +344,13 @@ end --- -- Returns the class name for a given symbol. --- If the symbol is sense.syntax.self and a class definition using the --- sense.syntax.class_definition keyword is found, that class is returned. +-- If the symbol is `sense.syntax.self` and a class definition using the +-- `sense.syntax.class_definition` keyword is found, that class is returned. -- Otherwise the buffer is searched backwards for a type declaration of the --- symbol according to the patterns in sense.syntax.type_declarations. --- @param sense The adeptsense returned by adeptsense.new(). +-- symbol according to the patterns in `sense.syntax.type_declarations`. +-- @param sense The Adeptsense returned by `adeptsense.new()`. -- @param symbol The symbol to get the class of. --- @return class or nil +-- @return class or `nil` -- @see syntax function get_class(sense, symbol) local buffer = buffer @@ -408,16 +408,16 @@ function get_class(sense, symbol) end -- Adds an inherited class's completions to the given completion list. --- @param sense The adeptsense returned by adeptsense.new(). +-- @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; +-- defaults to `false`. +-- @param only_funcs If `true`, adds only functions to the completion list; +-- defaults to `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 --- call to add_inherited(). +-- added. This prevents stack overflow errors. Should be `{}` on the initial +-- call to `add_inherited()`. local function add_inherited(sense, class, only_fields, only_funcs, c, added) local inherited_classes = sense.inherited_classes[class] if not inherited_classes or added[class] then return end @@ -439,12 +439,13 @@ end --- -- Returns a list of completions for the given symbol. --- @param sense The adeptsense returned by adeptsense.new(). +-- @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. --- @return completion_list or nil +-- @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`. +-- @return completion_list or `nil` function get_completions(sense, symbol, only_fields, only_functions) if only_fields and only_functions or not symbol then return nil end local compls = sense.completions @@ -493,11 +494,12 @@ 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 --- false. --- @return true on success or false. +-- @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. +-- @return `true` on success or `false`. -- @see get_symbol -- @see get_completions function complete(sense, only_fields, only_functions) @@ -511,8 +513,8 @@ function complete(sense, only_fields, only_functions) if not buffer.auto_c_choose_single or #completions ~= 1 then buffer:auto_c_show(#part, table.concat(completions, ' ')) else - -- Scintilla does not emit AUTO_C_SELECTION in this case. This is necessary - -- for autocompletion with multiple selections. + -- Scintilla does not emit `AUTO_C_SELECTION` in this case. This is + -- necessary for autocompletion with multiple selections. events.emit(events.AUTO_C_SELECTION, completions[1]:sub(#part + 1), buffer.current_pos) end @@ -521,13 +523,13 @@ end --- -- Sets the trigger for autocompletion. --- @param sense The adeptsense returned by adeptsense.new(). +-- @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_functions If true, this trigger only completes functions. --- Defaults to false. +-- @param only_fields If `true`, this trigger only completes fields. Defaults to +-- `false`. +-- @param only_functions If `true`, this trigger only completes functions. +-- Defaults to `false`. -- @usage sense:add_trigger('.') -- @usage sense:add_trigger(':', false, true) -- only functions -- @usage sense:add_trigger('->') @@ -546,10 +548,10 @@ end --- -- Returns a list of apidocs for the given symbol. -- If there are multiple apidocs, the index of one to display is the value of --- the 'pos' key in the returned list. --- @param sense The adeptsense returned by adeptsense.new(). +-- the `pos` key in the returned list. +-- @param sense The Adeptsense returned by `adeptsense.new()`. -- @param symbol The symbol to get apidocs for. --- @return apidoc_list or nil +-- @return apidoc_list or `nil` function get_apidoc(sense, symbol) if not symbol then return nil end local apidocs = { pos = 1 } @@ -582,8 +584,8 @@ end --- -- Shows a calltip with API documentation for the symbol behind the caret. --- @param sense The adeptsense returned by adeptsense.new(). --- @return true on success or false. +-- @param sense The Adeptsense returned by `adeptsense.new()`. +-- @return `true` on success or `false`. -- @see get_symbol -- @see get_apidoc function show_apidoc(sense) @@ -628,13 +630,13 @@ end --- -- Loads the given ctags file for autocompletion. --- It is recommended to pass '-n' to ctags in order to use line numbers instead +-- It is recommended to pass `-n` to ctags in order to use line numbers instead -- of text patterns to locate tags. This will greatly reduce memory usage for a --- large number of symbols if nolocations is not true. --- @param sense The adeptsense returned by adeptsense.new(). +-- large number of symbols if `nolocations` is not `true`. +-- @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. +-- @param nolocations If `true`, does not store the locations of the tags for +-- use by `goto_ctag()`. Defaults to `false`. function load_ctags(sense, tag_file, nolocations) local ctags_kinds = sense.ctags_kinds local completions = sense.completions @@ -708,8 +710,8 @@ end --- -- Displays a filteredlist of all known symbols of the given kind (classes, -- functions, fields, etc.) and jumps to the source of the selected one. --- @param sense The adeptsense returned by adeptsense.new(). --- @param k The ctag character kind (e.g. 'f' for a Lua function). +-- @param sense The Adeptsense returned by `adeptsense.new()`. +-- @param k The ctag character kind (e.g. `'f'` for a Lua function). -- @param title The title for the filteredlist dialog. function goto_ctag(sense, k, title) if not sense.locations[k] then return end -- no ctags loaded @@ -744,21 +746,21 @@ function goto_ctag(sense, k, title) end --- --- Called by load_ctags when a ctag kind is not recognized. +-- Called by `load_ctags()` when a ctag kind is not recognized. -- This method should be replaced with your own that is specific to the -- language. --- @param sense The adeptsense returned by adeptsense.new(). +-- @param sense The Adeptsense returned by `adeptsense.new()`. -- @param tag_name The tag name. -- @param file_name The name of the file the tag belongs to. --- @param ex_cmd The ex_cmd returned by ctags. --- @param ext_fields The ext_fields returned by ctags. +-- @param ex_cmd The `ex_cmd` returned by ctags. +-- @param ext_fields The `ext_fields` returned by ctags. function handle_ctag(sense, tag_name, file_name, ex_cmd, ext_fields) end --- --- Clears an adeptsense. +-- Clears an Adeptsense. -- This is necessary for loading a new ctags file or completions from a -- different project. --- @param sense The adeptsense returned by adeptsense.new(). +-- @param sense The Adeptsense returned by `adeptsense.new()`. function clear(sense) sense.inherited_classes = {} sense.completions = {} @@ -768,17 +770,17 @@ function clear(sense) end --- --- Called when clearing an adeptsense. +-- Called when clearing an Adeptsense. -- This function should be replaced with your own if you have any persistant -- objects that need to be deleted. --- @param sense The adeptsense returned by adeptsense.new(). +-- @param sense The Adeptsense returned by `adeptsense.new()`. function handle_clear(sense) end --- --- Creates a new adeptsense for the given lexer language. +-- Creates a new Adeptsense for the given lexer language. -- Only one sense can exist per language. --- @param lang The lexer language to create an adeptsense for. --- @return adeptsense. +-- @param lang The lexer language to create an Adeptsense for. +-- @return adeptsense -- @usage local lua_sense = _m.textadept.adeptsense.new('lua') function new(lang) local sense = senses[lang] @@ -798,11 +800,11 @@ function new(lang) always_show_globals = true, --- --- Contains a map of ctags kinds to adeptsense kinds. --- Recognized kinds are 'functions', 'fields', and 'classes'. Classes are quite --- simply containers for functions and fields so Lua modules would count as --- classes. Any other kinds will be passed to handle_ctag() for user-defined --- handling. +-- Contains a map of ctags kinds to Adeptsense kinds. +-- Recognized kinds are `'functions'`, `'fields'`, and `'classes'`. Classes are +-- quite simply containers for functions and fields so Lua modules would count +-- as classes. Any other kinds will be passed to `handle_ctag()` for +-- user-defined handling. -- @usage luasense.ctags_kinds = { 'f' = 'functions' } -- @usage csense.ctags_kinds = { 'm' = 'fields', 'f' = 'functions', -- c = 'classes', s = 'classes' } @@ -823,7 +825,7 @@ inherited_classes = {}, -- Contains lists of possible completions for known symbols. -- Each symbol key has a table value that contains a list of field completions -- with a `fields` key and a list of functions completions with a `functions` --- key. This table is normally populated by load_ctags(), but can also be set +-- key. This table is normally populated by `load_ctags()`, but can also be set -- by the user. -- @class table -- @name completions @@ -831,27 +833,27 @@ completions = {}, --- -- Contains the locations of known symbols. --- This table is populated by load_ctags(). +-- This table is populated by `load_ctags()`. -- @class table -- @name locations locations = {}, --- --- Contains a list of api files used by show_apidoc(). +-- Contains a list of api files used by `show_apidoc()`. -- Each line in the api file contains a symbol name (not the full symbol) -- followed by a space character and then the symbol's documentation. Since -- there may be many duplicate symbol names, it is recommended to put the full --- symbol and arguments, if any, on the first line. (e.g. Class.function(arg1, --- arg2, ...)). This allows the correct documentation to be shown based on the --- current context. In the documentation, newlines are represented with '\n'. A --- '\' before '\n' escapes the newline. +-- symbol and arguments, if any, on the first line. (e.g. `Class.function(arg1, +-- arg2, ...)`). This allows the correct documentation to be shown based on the +-- current context. In the documentation, newlines are represented with `\n`. A +-- `\` before `\n` escapes the newline. -- @class table -- @name api_files api_files = {}, --- -- Contains syntax-specific values for the language. --- @field self The language's syntax-equivalent of 'self'. Default is 'self'. +-- @field self The language's syntax-equivalent of `self`. Default is `'self'`. -- @field class_definition A Lua pattern representing the language's class -- definition syntax. The first capture returned must be the class name. A -- second, optional capture contains the class' superclass (if any). If no @@ -859,19 +861,19 @@ 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_]+)'. --- @field word_chars A Lua pattern of characters allowed in a word. Default is --- '%w_'. +-- instead. Defaults to `'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, --- including member operators. The pattern should be a character set. Default --- is '[%w_%.]'. +-- including member operators. The pattern should be a character set. The +-- 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. Defaults to '(%u[%w_%.]+)%s+%_'. +-- Use `%_` to match the symbol. The default 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. +-- a `true` boolean value. For example, `{ Foo = true }` excludes any type +-- whose name is `Foo`. Defaults to being empty. -- @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 @@ -902,7 +904,7 @@ end --- -- Completes the symbol at the current position based on the current lexer's -- Adeptsense. --- This should be called by key commands and menus instead of `complete`. +-- This should be called by key commands and menus instead of `complete()`. function complete_symbol() local m = _m[buffer:get_lexer()] if m and m.sense then m.sense:complete() end @@ -911,7 +913,7 @@ end --- -- Shows API documentation for the symbol at the current position based on the -- current lexer's Adeptsense. --- This should be called by key commands and menus instead of `show_apidoc`. +-- This should be called by key commands and menus instead of `show_apidoc()`. function show_documentation() local m = _m[buffer:get_lexer()] if m and m.sense then m.sense:show_apidoc() end diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua index a032d19c..0b90c28a 100644 --- a/modules/textadept/bookmarks.lua +++ b/modules/textadept/bookmarks.lua @@ -10,7 +10,7 @@ module('_m.textadept.bookmarks', package.seeall) -- ## Settings -- -- * `MARK_BOOKMARK_COLOR` [number]: The color used for a bookmarked line in --- 0xBBGGRR format. +-- `0xBBGGRR` format. -- settings MARK_BOOKMARK_COLOR = 0xC08040 diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index cb340cfc..06427795 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -13,19 +13,19 @@ module('_m.textadept.editing', package.seeall) -- -- * `AUTOPAIR` [bool]: Opening `(`, `[`, `[`, `"`, or `'` characters are -- automatically closed. The default value is `true`. --- * `HIGHLIGHT_BRACES` [bool]: Highlight matching '()[]{}<>' characters. The +-- * `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. +-- 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. +-- 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`. -- settings AUTOPAIR = true @@ -39,7 +39,7 @@ INDIC_HIGHLIGHT_ALPHA = 100 --- -- Comment strings for various lexer languages. --- Used for the block_comment() function. Keys are lexer language names and +-- Used for the `block_comment()` function. Keys are lexer language names and -- values are the line comment delimiters for the language. This table is -- typically populated by language-specific modules. -- @class table @@ -156,8 +156,8 @@ events.connect(events.AUTO_C_SELECTION, function(text, position) end) --- --- Goes to a matching brace position, selecting the text inside if specified. --- @param select If true, selects the text between matching braces. +-- Goes to a matching brace position, selecting the text inside if specified to. +-- @param select If `true`, selects the text between matching braces. function match_brace(select) local buffer = buffer local caret = buffer.current_pos @@ -179,7 +179,7 @@ end -- Pops up an autocompletion list for the current word based on other words in -- the document. -- @param word_chars String of chars considered to be part of words. --- @return true if there were completions to show; false otherwise. +-- @return `true` if there were completions to show; `false` otherwise. function autocomplete_word(word_chars) local buffer = buffer local caret, length = buffer.current_pos, buffer.length @@ -254,7 +254,8 @@ end --- -- Goes to the requested line. --- @param line Optional line number to go to. +-- @param line Optional line number to go to. If `nil`, the user is prompted for +-- one. function goto_line(line) if not line then line = tonumber(gui.dialog('standard-inputbox', @@ -305,7 +306,7 @@ events.connect(events.FILE_BEFORE_SAVE, prepare_for_save) --- -- Selects the current word under the caret and if action indicates, deletes it. --- @param action Optional action to perform with selected word. If 'delete', it +-- @param action Optional action to perform with selected word. If `delete`, it -- is deleted. function current_word(action) local buffer = buffer diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 8debc7ec..8187954e 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -88,12 +88,12 @@ end -- @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), -- whole word (4), Lua pattern (8), and in files (16) joined with binary OR. --- If nil, this is determined based on the checkboxes in the find box. --- @param nowrap Flag indicating whether or not the search won't wrap. +-- If `nil`, this is determined based on the checkboxes in the find box. +-- @param nowrap Flag indicating whether or not the search will not wrap. -- @param wrapped Utility flag indicating whether or not the search has wrapped -- for displaying useful statusbar information. This flag is used and set -- internally, and should not be set otherwise. --- @return position of the found text or -1 +-- @return position of the found text or `-1` local function find_(text, next, flags, nowrap, wrapped) if text == '' then return end local buffer = buffer @@ -161,7 +161,7 @@ events.connect(events.FIND, find_) -- Finds and selects text incrementally in the current buffer from a start -- point. --- Flags other than SCFIND_MATCHCASE are ignored. +-- Flags other than `SCFIND_MATCHCASE` are ignored. -- @param text The text to find. local function find_incremental(text) local flags = find.match_case and c.SCFIND_MATCHCASE or 0 @@ -206,7 +206,7 @@ local loadstring = loadstring local pcall = pcall -- Runs the given code. --- This function is passed to string.gsub() in the replace() function. +-- This function is passed to `string.gsub()` in the `replace()` function. -- @param code The code to run. local function run(code) local ok, val = pcall(loadstring('return '..code)) @@ -222,11 +222,11 @@ local function run(code) end -- Replaces found text. --- 'find_' is called first, to select any found text. The selected text is then --- replaced by the specified replacement 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'. -- @param rtext The text to replace found text with. It can contain both Lua --- capture items (%n where 1 <= n <= 9) for Lua pattern searches and %() +-- capture items (`%n` where 1 <= `n` <= 9) for Lua pattern searches and `%()` -- sequences for embedding Lua code for any search. -- @see find local function replace(rtext) @@ -259,7 +259,7 @@ events.connect(events.REPLACE, replace) -- This function ignores 'Find in Files'. -- @param ftext The text to find. -- @param rtext The text to replace found text with. --- @param flags The number mask identical to the one in 'find'. +-- @param flags The number mask identical to the one in `find_()`. -- @see find local function replace_all(ftext, rtext, flags) if #ftext == 0 then return end diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua index d022d47e..6832bb1f 100644 --- a/modules/textadept/menu.lua +++ b/modules/textadept/menu.lua @@ -6,7 +6,7 @@ local gui = gui --- -- Provides dynamic menus for Textadept. --- This module should be 'require'ed last, after _m.textadept.keys since it +-- This module should be `require`ed last, after `_m.textadept.keys` since it -- looks up defined key commands to show them in menus. module('_m.textadept.menu', package.seeall) @@ -216,7 +216,7 @@ menubar = { } --- --- Contains the right-click context menu. +-- Contains the default right-click context menu. -- @class table -- @name context_menu context_menu = { @@ -235,12 +235,13 @@ local key_shortcuts = {} local menu_actions = {} local contextmenu_actions = {} --- Creates a menu suitable for gui.gtkmenu from the menu table format. +-- Creates a menu suitable for `gui.gtkmenu()` from the menu table format. -- 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. --- @return gtkmenu that can be passed to gui.gtkmenu. +-- If so, menu_id offset is 1000. Defaults to `false`. +-- @return gtkmenu that can be passed to `gui.gtkmenu()`. +-- @see gui.gtkmenu local function read_menu_table(menu, contextmenu) local gtkmenu = {} gtkmenu.title = menu.title @@ -263,14 +264,14 @@ local function read_menu_table(menu, contextmenu) end --- --- Sets gui.menubar from the given table of menus. +-- Sets `gui.menubar` from the given table of menus. -- @param menubar The table of menus to create the menubar from. Each table -- entry is another table that corresponds to a particular menu. A menu can --- have a 'title' key with string value. Each menu item is either a submenu +-- have a `title` key with string value. Each menu item is either a submenu -- (another menu table) or a table consisting of two items: string menu text -- and a function or action table just like in `keys`. The table can -- optionally contain 2 more number values: a GDK keycode and modifier mask --- for setting a menu accelerator. If the menu text is 'separator', a menu +-- for setting a menu accelerator. If the menu text is `'separator'`, a menu -- separator is created and no action table is required. -- @see keys.get_gdk_key function set_menubar(menubar) @@ -286,7 +287,7 @@ end set_menubar(menubar) --- --- Sets gui.context_menu from the given menu table. +-- Sets `gui.context_menu` from the given menu table. -- @param menu_table The menu table to create the context menu from. Each table -- entry is either a submenu or menu text and a function or action table. -- @see set_menubar @@ -326,8 +327,8 @@ function select_command() end --- --- Rebuilds the tables used by select_command(). --- This should be called every time set_menubar() is called. +-- Rebuilds the tables used by `select_command()`. +-- This should be called every time `set_menubar()` is called. function rebuild_command_tables() items, commands = {}, {} build_command_tables(menubar, nil, items, commands) diff --git a/modules/textadept/mime_types.lua b/modules/textadept/mime_types.lua index 119d5b55..51b60636 100644 --- a/modules/textadept/mime_types.lua +++ b/modules/textadept/mime_types.lua @@ -14,7 +14,7 @@ module('_m.textadept.mime_types', package.seeall) -- -- * **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 +-- <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. @@ -50,7 +50,7 @@ shebangs = {} -- @name patterns patterns = {} --- Load mime-types from mime_types.conf +-- Load mime-types from `modules/textadept/mime_types.conf`. local mime_types local f = io.open(_HOME..'/modules/textadept/mime_types.conf', 'rb') if f then @@ -100,6 +100,14 @@ end for lexer in pairs(lexers_found) do lexers[#lexers + 1] = lexer end table.sort(lexers) +--- +-- Prompts the user to select a lexer from a filtered list for the current +-- buffer. +function select_lexer() + local lexer = gui.filteredlist(L('Select Lexer'), 'Name', lexers) + if lexer then buffer:set_lexer(lexer) end +end + -- LuaDoc is in core/.buffer.luadoc. local function get_style_name(buffer, style_num) buffer:check_global() @@ -109,7 +117,7 @@ end -- Contains the whitespace styles for lexers. -- These whitespace styles are used to determine the lexer at the current caret --- position since the styles have the name '[lang]_whitespace'. +-- position since the styles have the name `[lang]_whitespace`. -- @class table -- @name ws_styles local ws_styles = {} @@ -130,9 +138,8 @@ local function set_lexer(buffer, lang) local module_not_found = "^module '"..lang.."[^\']*' not found:" if not ok and not err:find(module_not_found) then error(err) end buffer:colourise(0, -1) + -- Create the ws_styles[lexer] lookup table for `get_lexer()`. if ws_styles[lang] then return end - - -- Create the ws_styles[lexer] lookup table for get_lexer(). local ws = {} for i = 0, 255 do ws[i] = buffer:private_lexer_call(i):find('whitespace') ~= nil @@ -196,11 +203,3 @@ events.connect(events.VIEW_NEW, restore_lexer, 1) events.connect(events.RESET_AFTER, function() buffer:set_lexer(buffer._lexer or 'container') end) - ---- --- Prompts the user to select a lexer from a filtered list for the current --- buffer. -function select_lexer() - local lexer = gui.filteredlist(L('Select Lexer'), 'Name', lexers) - if lexer then buffer:set_lexer(lexer) end -end diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index 567178fb..39a71db1 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -15,14 +15,14 @@ module('_m.textadept.run', package.seeall) -- -- * `_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 +-- 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 /> -- * `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), --- connect with an index of 1 and return `true` if the event was handled and +-- 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 /> -- * `lexer`: The lexer language. @@ -36,10 +36,10 @@ events.RUN_OUTPUT = 'run_output' -- Executes the command line parameter and prints the output to Textadept. -- @param command The command line string. -- It can have the following macros: --- * %(filepath) The full path of the current file. --- * %(filedir) The current file's directory path. --- * %(filename) The name of the file including extension. --- * %(filename_noext) The name of the file excluding extension. +-- + `%(filepath)`: The full path of the current file. +-- + `%(filedir)`: The current file's directory path. +-- + `%(filename)`: The name of the file including extension. +-- + `%(filename_noext)`: The name of the file excluding extension. function execute(command) local filepath = buffer.filename:iconv(_CHARSET, 'UTF-8') local filedir, filename = '', filepath @@ -63,7 +63,7 @@ function execute(command) end -- Executes a compile or run command. --- @param cmd_table Either compile_command or run_command +-- @param cmd_table Either `compile_command` or `run_command`. local function command(cmd_table) if not buffer.filename then return end buffer:save() @@ -82,7 +82,7 @@ end compile_command = {} --- --- Compiles the file as specified by its extension in the compile_command +-- Compiles the file as specified by its extension in the `compile_command` -- table. -- @see compile_command function compile() @@ -102,7 +102,7 @@ events.connect(events.COMPILE_OUTPUT, run_command = {} --- --- Runs/executes the file as specified by its extension in the run_command +-- Runs/executes the file as specified by its extension in the `run_command` -- table. -- @see run_command function run() @@ -114,15 +114,15 @@ events.connect(events.RUN_OUTPUT, --- -- A table of error string details. -- Each entry is a table with the following fields: --- pattern: the Lua pattern that matches a specific error string. --- filename: the index of the Lua capture that contains the filename the error --- occured in. --- line: the index of the Lua capture that contains the line number the error --- occured on. --- message: [Optional] the index of the Lua capture that contains the error's --- message. A call tip will be displayed if a message was captured. +-- + `pattern`: The Lua pattern that matches a specific error string. +-- + `filename`: The index of the Lua capture that contains the filename the +-- error occured in. +-- + `line`: The index of the Lua capture that contains the line number the +-- error occured on. +-- + `message`: [Optional] The index of the Lua capture that contains the +-- error's message. A call tip will be displayed if a message was captured. -- When an error message is double-clicked, the user is taken to the point of --- error. +-- error. -- This table is usually populated by language-specific modules. -- @class table -- @name error_detail diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua index 9890b7f2..00d73b56 100644 --- a/modules/textadept/session.lua +++ b/modules/textadept/session.lua @@ -11,10 +11,10 @@ module('_m.textadept.session', package.seeall) -- -- * `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. +-- `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. +-- files list to save to the session. The default is `10`. -- settings DEFAULT_SESSION = _USERHOME..'/session' @@ -27,8 +27,8 @@ MAX_RECENT_FILES = 10 -- 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. --- @return true if the session file was opened and read; false otherwise. +-- `DEFAULT_SESSION` if not specified. +-- @return `true` if the session file was opened and read; `false` otherwise. -- @usage _m.textadept.session.load(filename) function load(filename) local not_found = {} @@ -104,7 +104,7 @@ events.connect('arg_none', function() if SAVE_ON_QUIT then load() end end) -- 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. +-- either the current session file or `DEFAULT_SESSION` if not specified. -- @usage _m.textadept.session.save(filename) function save(filename) local session = {} @@ -196,4 +196,3 @@ events.connect(events.QUIT, function() if SAVE_ON_QUIT then save() end end, 1) local function no_session() SAVE_ON_QUIT = false end args.register('-n', '--nosession', 0, no_session, 'No session functionality') - diff --git a/modules/textadept/snapopen.lua b/modules/textadept/snapopen.lua index 17979a2d..f06d9260 100644 --- a/modules/textadept/snapopen.lua +++ b/modules/textadept/snapopen.lua @@ -11,8 +11,9 @@ module('_m.textadept.snapopen', package.seeall) -- -- * `PATHS` [table]: Table of default UTF-8 paths to search. -- * `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. +-- value is `4`. +-- * `MAX` [number]: Maximum number of files to list. The default value is +-- `1000`. -- -- ## Examples -- @@ -43,7 +44,7 @@ local DEPTH = DEFAULT_DEPTH -- Determines whether or not the given file matches the given filter. -- @param file The filename. -- @param filter The filter table. --- @return boolean true or false. +-- @return boolean `true` or `false`. local function exclude(file, filter) if not filter then return false end local string_match, string_sub = string.match, string.sub @@ -88,14 +89,14 @@ end -- paths to search. -- @param filter A filter for files and folders to exclude. The filter may be -- a string or table. Each filter is a Lua pattern. Any files matching a --- filter are excluded. Prefix a pattern with '!' to exclude any files that +-- filter are excluded. Prefix a pattern with `!` to exclude any files that -- do not match the filter. Directories can be excluded by adding filters to --- a table assigned to a 'folders' key in the filter table. All strings should +-- a table assigned to a `folders` key in the filter table. All strings should -- be UTF-8 encoded. --- @param exclusive Flag indicating whether or not to exclude PATHS in the --- search. Defaults to false. +-- @param exclusive Flag indicating whether or not to exclude `PATHS` in the +-- search. Defaults to `false`. -- @param depth Number of directories to recurse into for finding files. --- Defaults to DEFAULT_DEPTH. +-- Defaults to `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 337e056e..23638862 100644 --- a/modules/textadept/snippets.lua +++ b/modules/textadept/snippets.lua @@ -120,8 +120,8 @@ module('_m.textadept.snippets', package.seeall) -- The stack of currently running snippets. local snippet_stack = {} --- Contains newline sequences for buffer.eol_mode. --- This table is used by new_snippet(). +-- Contains newline sequences for `buffer.eol_mode`. +-- This table is used by `new_snippet()`. -- @class table -- @name newlines local newlines = { [0] = '\r\n', '\r', '\n' } @@ -174,7 +174,7 @@ end -- Inserts a snippet. -- @param text Optional snippet text. If none is specified, the snippet text -- is determined from the trigger and lexer. --- @return false if no snippet was expanded; true otherwise. +-- @return `false` if no snippet was expanded; `true` otherwise. function _insert(text) local buffer = buffer local trigger @@ -196,7 +196,7 @@ end --- -- Goes back to the previous placeholder, reverting any changes from the current -- one. --- @return false if no snippet is active; nil otherwise. +-- @return `false` if no snippet is active; `nil` otherwise. function _previous() if #snippet_stack == 0 then return false end snippet_stack[#snippet_stack]:previous() @@ -253,8 +253,8 @@ local escapes = { -- @class table -- @name _snippet_mt _snippet_mt = { - -- Gets a snippet's end position in the Scintilla buffer. - -- @param snippet The snippet returned by new_snippet(). + -- Gets a snippet's end position in the buffer. + -- @param snippet The snippet returned by `new_snippet()`. get_end_position = function(snippet) local e = buffer:indicator_end(INDIC_SNIPPET, snippet.start_position + 1) if e == 0 then e = snippet.start_position end @@ -262,7 +262,7 @@ _snippet_mt = { end, -- Gets the text for a snippet. - -- @param snippet The snippet returned by new_snippet(). + -- @param snippet The snippet returned by `new_snippet()`. get_text = function(snippet) local s, e = snippet.start_position, snippet:get_end_position() local ok, text = pcall(buffer.text_range, buffer, s, e) @@ -270,8 +270,8 @@ _snippet_mt = { end, -- Sets the text for a snippet. - -- This text will be displayed immediately in the Scintilla buffer. - -- @param snippet The snippet returned by new_snippet(). + -- This text will be displayed immediately in the buffer. + -- @param snippet The snippet returned by `new_snippet()`. -- @param text The snippet's text. set_text = function(snippet, text) local buffer = buffer @@ -281,25 +281,25 @@ _snippet_mt = { end, -- Returns the escaped form of the snippet's text. - -- @param snippet The snippet returned by new_snippet(). + -- @param snippet The snippet returned by `new_snippet()`. -- @see escapes get_escaped_text = function(snippet) return snippet:get_text():gsub('%%[%%%(%)>%]]', escapes) end, -- Returns the unescaped form of the given text. - -- This does the opposite of get_escaped_text() by default. The behaviour is - -- slightly different when the 'complete' parameter is true. + -- This does the opposite of `get_escaped_text()` by default. The behaviour is + -- 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 '%'. Defaults to `false`. unescape_text = function(text, complete) text = text:gsub('\027.', escapes) return complete and text:gsub('%%([%%%(%)>%]])', '%1') or text end, -- Executes code in the snippet for the given index. - -- @param snippet The snippet returned by new_snippet(). + -- @param snippet The snippet returned by `new_snippet()`. -- @param index Execute code with this index. execute_code = function(snippet, index) local escaped_text = snippet:get_escaped_text() @@ -322,7 +322,7 @@ _snippet_mt = { end, -- Goes to the next placeholder in a snippet. - -- @param snippet The snippet returned by new_snippet(). + -- @param snippet The snippet returned by `new_snippet()`. next = function(snippet) local buffer = buffer -- If the snippet was just initialized, determine how many placeholders it @@ -374,7 +374,7 @@ _snippet_mt = { end, -- Goes to the previous placeholder in a snippet. - -- @param snippet The snippet returned by new_snippet(). + -- @param snippet The snippet returned by `new_snippet()`. previous = function(snippet) if snippet.index > 2 then snippet:set_text(snippet.snapshots[snippet.index - 2]) @@ -386,7 +386,7 @@ _snippet_mt = { end, -- Cancels a snippet. - -- @param snippet The snippet returned by new_snippet(). + -- @param snippet The snippet returned by `new_snippet()`. cancel = function(snippet) local buffer = buffer buffer:set_sel(snippet.start_position, snippet:get_end_position()) @@ -396,8 +396,8 @@ _snippet_mt = { snippet_stack[#snippet_stack] = nil end, - -- Finishes a snippet by going to its '%0' placeholder and cleaning up. - -- @param snippet The snippet returned by new_snippet(). + -- Finishes a snippet by going to its `%0` placeholder and cleaning up. + -- @param snippet The snippet returned by `new_snippet()`. finish = function(snippet) local buffer = buffer snippet:set_text(snippet.unescape_text(snippet:get_text(), true)) @@ -423,7 +423,7 @@ events.connect(events.VIEW_NEW, function() buffer.indic_style[INDIC_SNIPPET] = INDIC_HIDDEN end) --- --- Provides access to snippets from _G. +-- Provides access to snippets from `_G`. -- @class table -- @name _G.snippets _G.snippets = _M |