diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/._M.luadoc | 61 | ||||
-rw-r--r-- | core/.buffer.luadoc | 520 | ||||
-rw-r--r-- | core/args.lua | 4 | ||||
-rw-r--r-- | core/events.lua | 186 | ||||
-rw-r--r-- | core/file_io.lua | 21 | ||||
-rw-r--r-- | core/init.lua | 11 | ||||
-rw-r--r-- | core/keys.lua | 19 | ||||
-rw-r--r-- | core/locale.lua | 8 |
8 files changed, 416 insertions, 414 deletions
diff --git a/core/._M.luadoc b/core/._M.luadoc index 04d2e938..bf9ed787 100644 --- a/core/._M.luadoc +++ b/core/._M.luadoc @@ -13,52 +13,64 @@ module('_M')]] -- Note that while language-specific modules can only be used by files of that -- language, they persist in Textadept's Lua state. Because of this, it is not -- recommended to set global functions or variables and depend on them, as they --- may be inadvertantly overwritten. Keep these inside the module. +-- may be inadvertantly overwritten. Keep them inside the module. -- -- ## Structure -- -- Each module should have an `init.lua` that `require`s all submodules it -- needs. For an example, see `modules/textadept/init.lua`. -- --- ## Recommended Features for Language-Specific Modules +-- ## Language-Specific Modules -- --- #### Snippets +-- The following is a list of recommended features for Language-Specific +-- modules. They are all entirely optional. -- --- [Snippets](../modules/_M.textadept.snippets.html) for common code constructs. +-- ### Snippets -- --- #### Commands +-- [Snippets][] for common code constructs. -- --- ##### Run +-- [Snippets]: _M.textadept.snippets.html +-- +-- ### Commands +-- +-- #### Run -- -- If the code can be run by an interpreter or other executable, create a [run --- command](../modules/_M.textadept.run.html#run_command) for it as well as an --- [error format](../modules/_M.textadept.run.html#error_detail) for the ability --- to jump to the position in a file where the error occured. +-- command][] for it as well as an [error format][] for the ability to jump to +-- the position in a file where the error occured. -- -- For example: -- -- _M.textadept.run.run_command.lua = 'lua %(filename)' -- --- ##### Compile +-- [run command]: _M.textadept.run.html#run_command +-- [error format]: _M.textadept.run.html#error_detail +-- +-- #### Compile -- --- If the code can be compiled by an executable, create a [compile --- command](../modules/_M.textadept.run.html#compile_command) for it. +-- If the code can be compiled by an executable, create a [compile command][] +-- for it. -- -- For example: -- -- _M.textadept.run.compile_command.lua = 'luac %(filename)' -- --- ##### Block Comment +-- [compile command]: _M.textadept.run.html#compile_command +-- +-- #### Block Comment +-- +-- Create a [comment prefix][] for it so code can be easily commented and +-- uncommented. -- --- Create a [comment --- prefix](../modules/_M.textadept.editing.html#comment_string) for it so code --- can be easily commented and uncommented. +-- [comment prefix]: _M.textadept.editing.html#comment_string -- -- For example: -- -- _M.textadept.editing.comment_string.lua = '--' -- --- #### Buffer Properties +-- [comment prefix]: _M.textadept.editing.html#comment_string +-- +-- ### Buffer Properties -- -- Add a `set_buffer_properties` function with default buffer properties for -- code like tab and indentation settings. @@ -72,7 +84,7 @@ module('_M')]] -- buffer.indent = 2 -- end -- --- #### Context Menu (Optional) +-- ### Context Menu -- -- Language-specific context menus, accessible by right-clicking inside the -- view, can be defined as: @@ -84,16 +96,3 @@ module('_M')]] -- } -- -- See `modules/textadept/menu.lua` for examples on how to define menus. --- --- ## Modules and Key Commands --- --- When assigning [key commands](../modules/_M.textadept.keys.html) to module --- functions, do not forget to do so AFTER the function has been defined. --- Typically key commands are placed at the end of files, like `init.lua` in --- the `textadept` module. - ---- --- This module contains no functions. --- @class function --- @name no_functions -local no_functions diff --git a/core/.buffer.luadoc b/core/.buffer.luadoc index e2acea09..52be35cf 100644 --- a/core/.buffer.luadoc +++ b/core/.buffer.luadoc @@ -45,13 +45,12 @@ module('buffer') -- looking up the style. -- * `annotation_visible` [number] -- The visibility of annotations. --- * `_SCINTILLA.constants.ANNOTATION_HIDDEN` (0) --- Annotations are not displayed. --- * `_SCINTILLA.constants.ANNOTATION_STANDARD` (1) --- Annotations are drawn left justified with no adornment. --- * `_SCINTILLA.constants.ANNOTATION_BOXED` (2) --- Annotations are indented to match the text and are surrounded by a --- box. +-- * `_SCINTILLA.constants.ANNOTATION_HIDDEN` (0) +-- Annotations are not displayed. +-- * `_SCINTILLA.constants.ANNOTATION_STANDARD` (1) +-- Annotations are drawn left justified with no adornment. +-- * `_SCINTILLA.constants.ANNOTATION_BOXED` (2) +-- Annotations are indented to match the text and are surrounded by a box. -- * `auto_c_auto_hide` [bool] -- Whether or not autocompletion is hidden automatically when nothing matches. -- By default, the list is cancelled if there are no viable matches (the user @@ -131,26 +130,26 @@ module('buffer') -- 500 milliseconds. -- * `caret_sticky` [number] -- The caret preferred x position changing when the user types. --- * `_SCINTILLA.constants.SC_CARETSTICKY_OFF` (0) --- All text changes (and all caret position changes) will remember the --- caret's new horizontal position when moving to different lines. --- This is the default. --- * `_SCINTILLA.constants.SC_CARETSTICKY_ON` (1) --- The only thing which will cause the editor to remember the horizontal --- caret position is moving the caret with mouse or keyboard (left/right --- arrow keys, home/end keys, etc). --- * `_SCINTILLA.constants.SC_CARETSTICKY_WHITESPACE` (2) --- The caret acts like sticky off except under one special case; when --- space or tab characters are inserted. (Including pasting --- *only space/tabs* -- undo, redo, etc. do not exhibit this behavior.) +-- * `_SCINTILLA.constants.SC_CARETSTICKY_OFF` (0) +-- All text changes (and all caret position changes) will remember the +-- caret's new horizontal position when moving to different lines. +-- This is the default. +-- * `_SCINTILLA.constants.SC_CARETSTICKY_ON` (1) +-- The only thing which will cause the editor to remember the horizontal +-- caret position is moving the caret with mouse or keyboard (left/right +-- arrow keys, home/end keys, etc). +-- * `_SCINTILLA.constants.SC_CARETSTICKY_WHITESPACE` (2) +-- The caret acts like sticky off except under one special case; when +-- space or tab characters are inserted. (Including pasting +-- *only space/tabs* -- undo, redo, etc. do not exhibit this behavior.) -- * `caret_style` [number] -- The style of the caret to be drawn. --- * `_SCINTILLA.constants.CARETSTYLE_INVISIBLE` (0) --- Not draw the caret at all. --- * `_SCINTILLA.constants.CARETSTYLE_LINE` (1) --- A line caret. This is the default value. --- * `_SCINTILLA.constants.CARETSTYLE_BLOCK` (2) --- A block caret. +-- * `_SCINTILLA.constants.CARETSTYLE_INVISIBLE` (0) +-- Not draw the caret at all. +-- * `_SCINTILLA.constants.CARETSTYLE_LINE` (1) +-- A line caret. This is the 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 @@ -174,10 +173,10 @@ module('buffer') -- When setting, the caret is not scrolled into view. -- * `cursor` [number] -- The cursor type. --- * `_SCINTILLA.constants.SC_CURSORNORMAL` (-1) --- The normal cursor is displayed. --- * `_SCINTILLA.constants.SC_CURSORWAIT` (4) --- The wait cursor is displayed when the mouse is over the view. +-- * `_SCINTILLA.constants.SC_CURSORNORMAL` (-1) +-- The normal cursor is displayed. +-- * `_SCINTILLA.constants.SC_CURSORWAIT` (4) +-- The wait cursor is displayed when the mouse is over the view. -- * `direct_function` [number] (Read-only) -- A pointer to a function that processes messages for this view. -- * `direct_pointer` [number] (Read-only) @@ -188,26 +187,26 @@ module('buffer') -- last saved. -- * `eol_mode` [number] -- The current end of line mode. --- * `_SCINTILLA.constants.SC_EOL_CRLF` (0) --- `CRLF`. --- * `_SCINTILLA.constants.SC_EOL_CR` (1) --- `CR`. --- * `_SCINTILLA.constants.SC_EOL_LF` (2) --- `LF`. +-- * `_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` format. -- * `edge_column` [number] -- The column number which text should be kept within. -- * `edge_mode` [number] -- The edge highlight mode. --- * `_SCINTILLA.constants.EDGE_NONE` (0) --- Long lines are not marked. This is the default state. --- * `_SCINTILLA.constants.EDGE_LINE` (1) --- A vertical line is drawn at the column number set by --- `buffer.edge_column`. --- * `_SCINTILLA.constants.EDGE_BACKGROUND` (2) --- The background color of characters after the column limit is changed --- to the color set by `buffer.edge_colour`. +-- * `_SCINTILLA.constants.EDGE_NONE` (0) +-- Long lines are not marked. This is the default state. +-- * `_SCINTILLA.constants.EDGE_LINE` (1) +-- A vertical line is drawn at the column number set by +-- `buffer.edge_column`. +-- * `_SCINTILLA.constants.EDGE_BACKGROUND` (2) +-- The background color of 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. @@ -228,8 +227,7 @@ module('buffer') -- added to each line. -- * `filename` [string] -- The absolute path to the file associated with this buffer. --- It is encoded in UTF-8. Use [`string.iconv()`][string_iconv] for charset --- conversions. +-- It is encoded in UTF-8. Use [`string.iconv()`][] for charset conversions. -- * `first_visible_line` [number] -- The display line at the top of the display. -- * `focus` [bool] @@ -240,21 +238,21 @@ module('buffer') -- Table of fold levels for lines starting from zero. -- Fold levels encodes an integer level along with flags indicating whether -- the line is a header and whether it is effectively white space. --- * `_SCINTILLA.constants.SC_FOLDLEVELBASE` (0x400) --- Initial fold level. --- * `_SCINTILLA.constants.SC_FOLDLEVELWHITEFLAG` (0x1000) --- Indicates that the line is blank. --- * `_SCINTILLA.constants.SC_FOLDLEVELHEADERFLAG` (0x2000) --- Indicates that the line is a header (fold point). +-- * `_SCINTILLA.constants.SC_FOLDLEVELBASE` (0x400) +-- Initial fold level. +-- * `_SCINTILLA.constants.SC_FOLDLEVELWHITEFLAG` (0x1000) +-- Indicates that the line is blank. +-- * `_SCINTILLA.constants.SC_FOLDLEVELHEADERFLAG` (0x2000) +-- Indicates that the line is a header (fold point). -- * `fold_parent` [table] (Read-only) -- Table of parent line numbers for child lines starting from zero. -- `-1` means no line was found. -- * `font_quality` [number] (Windows only) -- The quality level for text. --- * `_SCINTILLA.constants.SC_EFF_QUALITY_DEFAULt` (0). --- * `_SCINTILLA.constants.SC_EFF_QUALITY_NON_ANTIALIASED` (1). --- * `_SCINTILLA.constants.SC_EFF_QUALITY_ANTIALIASED` (2). --- * `_SCINTILLA.constants.SC_EFF_QUALITY_LCD_OPTIMIZED` (3). +-- * `_SCINTILLA.constants.SC_EFF_QUALITY_DEFAULt` (0). +-- * `_SCINTILLA.constants.SC_EFF_QUALITY_NON_ANTIALIASED` (1). +-- * `_SCINTILLA.constants.SC_EFF_QUALITY_ANTIALIASED` (2). +-- * `_SCINTILLA.constants.SC_EFF_QUALITY_LCD_OPTIMIZED` (3). -- * `h_scroll_bar` [bool] -- Whether the horizontal scroll bar is visible. -- Set to `false` to never see it and `true` to enable it again. The default @@ -274,21 +272,21 @@ module('buffer') -- Indentation guides appearance. -- Indentation guides are dotted vertical lines that appear within indentation -- white space every indent size columns. --- * `_SCINTILLA.constants.SC_IV_NONE` (0) --- No indentation guides are shown. --- * `_SCINTILLA.constants.SC_IV_REAL` (1) --- Indentation guides are shown inside real indentation white space. --- * `_SCINTILLA.constants.SC_IV_LOOKFORWARD` (2) --- Indentation guides are shown beyond the actual indentation up to the --- level of the next non-empty line. --- If the previous non-empty line was a fold header then indentation --- guides are shown for one more level of indent than that line. This --- setting is good for Python. --- * `_SCINTILLA.constants.SC_IV_LOOKBOTH` (3) --- Indentation guides are 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. +-- * `_SCINTILLA.constants.SC_IV_NONE` (0) +-- No indentation guides are shown. +-- * `_SCINTILLA.constants.SC_IV_REAL` (1) +-- Indentation guides are shown inside real indentation white space. +-- * `_SCINTILLA.constants.SC_IV_LOOKFORWARD` (2) +-- Indentation guides are shown beyond the actual indentation up to the +-- level of the next non-empty line. +-- If the previous non-empty line was a fold header then indentation +-- guides are shown for one more level of indent than that line. This +-- setting is good for Python. +-- * `_SCINTILLA.constants.SC_IV_LOOKBOTH` (3) +-- Indentation guides are 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`. @@ -304,48 +302,48 @@ module('buffer') -- `INDIC_STRAIGHTBOX` rectangle. -- * `indic_style` [table] -- Table of styles for indicators from `0` to `31`. --- * `_SCINTILLA.constants.INDIC_PLAIN` (0) --- Underlined with a single, straight line. --- * `_SCINTILLA.constants.INDIC_SQUIGGLE` (1) --- A squiggly underline. Requires 3 pixels of descender space. --- * `_SCINTILLA.constants.INDIC_TT` (2) --- A line of small T shapes. --- * `_SCINTILLA.constants.INDIC_DIAGONAL` (3) --- Diagonal hatching. --- * `_SCINTILLA.constants.INDIC_STRIKE` (4) --- Strike out. --- * `_SCINTILLA.constants.INDIC_HIDDEN` (5) --- An indicator with no visual effect. --- * `_SCINTILLA.constants.INDIC_BOX` (6) --- A rectangle around the text. --- * `_SCINTILLA.constants.INDIC_ROUNDBOX` (7) --- A rectangle with rounded 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 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 outline color. --- * `_SCINTILLA.constants.INDIC_DASH` (9) --- A dashed underline. --- * `_SCINTILLA.constants.INDIC_DOTS` (10) --- A dotted underline. --- * `_SCINTILLA.constants.INDIC_SQUIGGLELOW` (11) --- Similar to `INDIC_SQUIGGLE` but only using 2 vertical pixels so will --- fit under small fonts. --- * `_SCINTILLA.constants.INDIC_DOTBOX` (12) --- A dotted rectangle around the text using translucent drawing. --- Translucency alternates between 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 avoid excessive memory allocation the maximum width of a --- dotted box is 4000 pixels. --- * Use `_SCINTILLA.next_indic_number()` for custom indicators. +-- * `_SCINTILLA.constants.INDIC_PLAIN` (0) +-- Underlined with a single, straight line. +-- * `_SCINTILLA.constants.INDIC_SQUIGGLE` (1) +-- A squiggly underline. Requires 3 pixels of descender space. +-- * `_SCINTILLA.constants.INDIC_TT` (2) +-- A line of small T shapes. +-- * `_SCINTILLA.constants.INDIC_DIAGONAL` (3) +-- Diagonal hatching. +-- * `_SCINTILLA.constants.INDIC_STRIKE` (4) +-- Strike out. +-- * `_SCINTILLA.constants.INDIC_HIDDEN` (5) +-- An indicator with no visual effect. +-- * `_SCINTILLA.constants.INDIC_BOX` (6) +-- A rectangle around the text. +-- * `_SCINTILLA.constants.INDIC_ROUNDBOX` (7) +-- A rectangle with rounded 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 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 outline color. +-- * `_SCINTILLA.constants.INDIC_DASH` (9) +-- A dashed underline. +-- * `_SCINTILLA.constants.INDIC_DOTS` (10) +-- A dotted underline. +-- * `_SCINTILLA.constants.INDIC_SQUIGGLELOW` (11) +-- Similar to `INDIC_SQUIGGLE` but only using 2 vertical pixels so will +-- fit under small fonts. +-- * `_SCINTILLA.constants.INDIC_DOTBOX` (12) +-- A dotted rectangle around the text using translucent drawing. +-- Translucency alternates between 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 +-- 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 `0` to `31`. @@ -359,15 +357,15 @@ module('buffer') -- Interpret keyboard input as Unicode. -- * `layout_cache` [number] -- The degree of caching of layout information. --- * `_SCINTILLA.constants.SC_CACHE_NONE` (0) --- No lines are cached. --- * `_SCINTILLA.constants.SC_CACHE_CARET` (1) --- The line containing the text caret. --- This is the default. --- * `_SCINTILLA.constants.SC_CACHE_PAGE` (2) --- Visible lines plus the line containing the caret. --- * `_SCINTILLA.constants.SC_CACHE_DOCUMENT` (3) --- All lines in the document. +-- * `_SCINTILLA.constants.SC_CACHE_NONE` (0) +-- No lines are cached. +-- * `_SCINTILLA.constants.SC_CACHE_CARET` (1) +-- The line containing the text caret. +-- This is the default. +-- * `_SCINTILLA.constants.SC_CACHE_PAGE` (2) +-- Visible lines plus the line containing the caret. +-- * `_SCINTILLA.constants.SC_CACHE_DOCUMENT` (3) +-- All lines in the document. -- * `length` [number] (Read-only) -- The number of bytes in the document. -- * `lexer` [number] @@ -404,10 +402,10 @@ module('buffer') -- * `margin_cursor_n` [table] -- Table of cursors shown for margins from zero to four. -- A reversed arrow cursor is normally shown over all margins. --- * `_SCINTILLA.constants.SC_CURSORARROW` --- Normal arrow. --- * `_SCINTILLA.constants.SC_CURSORREVERSEARROW` --- Reversed arrow. +-- * `_SCINTILLA.constants.SC_CURSORARROW` +-- Normal arrow. +-- * `_SCINTILLA.constants.SC_CURSORREVERSEARROW` +-- Reversed arrow. -- * `margin_left` [number] -- The size in pixels of the left margin. -- The default is to one pixel. @@ -416,13 +414,13 @@ module('buffer') -- A mask determines which markers are displayed in a margin. -- * `margin_options` [number] -- A bit mask of margin options. --- * `_SCINTILLA.constants.SC_MARGINOPTION_NONE` (0) --- None (default). --- * `_SCINTILLA.constants.SC_MARGINOPTION_SUBLINESELECT` (1) --- Controls how wrapped lines are selected when clicking on margin in --- front of them. --- If set, only sub line of wrapped line is selected, otherwise whole --- wrapped line is selected. +-- * `_SCINTILLA.constants.SC_MARGINOPTION_NONE` (0) +-- None (default). +-- * `_SCINTILLA.constants.SC_MARGINOPTION_SUBLINESELECT` (1) +-- Controls how wrapped lines are selected when clicking on margin in +-- front of them. +-- If set, only sub line of wrapped line is selected, otherwise whole +-- wrapped line is selected. -- * `margin_right` [number] -- The size in pixels of the right margin. -- The default is to one pixel. @@ -441,20 +439,20 @@ module('buffer') -- the offset added before looking up the style. -- * `margin_type_n` [table] -- Table of margin types for margins from zero to four. --- * `_SCINTILLA.constants.SC_MARGIN_SYMBOL` (0) --- A symbol margin. --- * `_SCINTILLA.constants.SC_MARGIN_NUMBER` (1) --- A line number margin. --- * `_SCINTILLA.constants.SC_MARGIN_BACK` (2) --- A symbol margin that sets its background color to match the default --- text background color. --- * `_SCINTILLA.constants.SC_MARGIN_FORE` (3) --- A symbol margin that sets its background color to match the default --- text foreground color. --- * `_SCINTILLA.constants.SC_MARGIN_TEXT` (4) --- A text margin. --- * `_SCINTILLA.constants.SC_MARGIN_RTEXT` (5) --- A right justified text margin. +-- * `_SCINTILLA.constants.SC_MARGIN_SYMBOL` (0) +-- A symbol margin. +-- * `_SCINTILLA.constants.SC_MARGIN_NUMBER` (1) +-- A line number margin. +-- * `_SCINTILLA.constants.SC_MARGIN_BACK` (2) +-- A symbol margin that sets its background color to match the default +-- text background color. +-- * `_SCINTILLA.constants.SC_MARGIN_FORE` (3) +-- A symbol margin that sets its background color to match the default +-- text foreground color. +-- * `_SCINTILLA.constants.SC_MARGIN_TEXT` (4) +-- A text margin. +-- * `_SCINTILLA.constants.SC_MARGIN_RTEXT` (5) +-- A right justified text margin. -- * `margin_width_n` [table] -- Table of margin widths expressed in pixes for margins from zero to four. -- * `max_line_state` [number] (Read-only) @@ -469,10 +467,10 @@ module('buffer') -- events are generated. -- * `multi_paste` [bool] -- The effect of pasting when there are multiple selections. --- * `_SCINTILLA.constants.SC_MULTIPASTE_ONCE` (0) --- Pasted text can go into just the main selection (default). --- * `_SCINTILLA.constants.SC_MULTIPASTE_EACH` (1) --- Pasted text can go into each selection. +-- * `_SCINTILLA.constants.SC_MULTIPASTE_ONCE` (0) +-- Pasted text can go into just the main selection (default). +-- * `_SCINTILLA.constants.SC_MULTIPASTE_EACH` (1) +-- Pasted text can go into each selection. -- * `multiple_selection` [bool] -- Whether multiple selections can be made. -- When multiple selection is disabled, it is not possible to select multiple @@ -485,33 +483,33 @@ module('buffer') -- that their layout can be determined more quickly if the run recurs. -- * `print_colour_mode` [number] -- The print color mode. --- * `_SCINTILLA.constants.SC_PRINT_NORMAL` (0) --- Print using the current screen colors. --- This is the default. --- * `_SCINTILLA.constants.SC_PRINT_INVERTLIGHT` (1) --- If you use a dark screen background this saves ink by inverting the --- light value of all colors and printing on a white background. --- * `_SCINTILLA.constants.SC_PRINT_BLACKONWHITE` (2) --- Print all text as black on a white background. --- * `_SCINTILLA.constants.SC_PRINT_COLOURONWHITE` (3) --- Everything prints in its own color on a white background. --- * `_SCINTILLA.constants.SC_PRINT_COLOURONWHITEDEFAULTBG` (4) --- Everything prints in its own color on a white background except that --- line numbers use their own background color. +-- * `_SCINTILLA.constants.SC_PRINT_NORMAL` (0) +-- Print using the current screen colors. +-- This is the default. +-- * `_SCINTILLA.constants.SC_PRINT_INVERTLIGHT` (1) +-- If you use a dark screen background this saves ink by inverting the +-- light value of all colors and printing on a white background. +-- * `_SCINTILLA.constants.SC_PRINT_BLACKONWHITE` (2) +-- Print all text as black on a white background. +-- * `_SCINTILLA.constants.SC_PRINT_COLOURONWHITE` (3) +-- Everything prints in its own color on a white background. +-- * `_SCINTILLA.constants.SC_PRINT_COLOURONWHITEDEFAULTBG` (4) +-- Everything prints in its own color on a white background except that +-- line numbers use their own background color. -- * `print_magnification` [number] -- The print magnification added to the point size of each style for printing. -- * `print_wrap_mode` [number] -- Printing line wrap mode. --- * `_SCINTILLA.constants.SC_WRAP_NONE` (0) --- Each line of text generates one line of output and the line is --- truncated if it is too long to fit into the print area. --- * `_SCINTILLA.constants.SC_WRAP_WORD` (1) --- Wraps printed output so that all characters fit into the print --- rectangle. --- Tries to wrap only between words as indicated by white space or style --- changes although if a word is longer than a line, it will be wrapped --- before the line end. This is the default. --- * `_SCINTILLA.constants.SC_WRAP_CHAR` (2). +-- * `_SCINTILLA.constants.SC_WRAP_NONE` (0) +-- Each line of text generates one line of output and the line is +-- truncated if it is too long to fit into the print area. +-- * `_SCINTILLA.constants.SC_WRAP_WORD` (1) +-- Wraps printed output so that all characters fit into the print +-- rectangle. +-- Tries to wrap only between words as indicated by white space or style +-- changes although if a word is longer than a line, it will be wrapped +-- before the line end. This is the default. +-- * `_SCINTILLA.constants.SC_WRAP_CHAR` (2). -- * `property` [table] (Write-only) -- Table of keyword:value string pairs used by a lexer for some optional -- features. @@ -531,12 +529,12 @@ module('buffer') -- * `rectangular_selection_modifier` [number] -- The modifier key used to indicate that a rectangular selection should be -- created when combined with a mouse drag. --- * `_SCINTILLA.constants.SCMOD_CTRL` (2) --- Control key (default). --- * `_SCINTILLA.constants.SCMOD_ALT` (4) --- Alt key. --- * `_SCINTILLA.constants.SCMOD_SUPER` (8) --- Left Windows key on a Windows keyboard or the Command key on a Mac. +-- * `_SCINTILLA.constants.SCMOD_CTRL` (2) +-- Control key (default). +-- * `_SCINTILLA.constants.SCMOD_ALT` (4) +-- Alt key. +-- * `_SCINTILLA.constants.SCMOD_SUPER` (8) +-- Left Windows key on a Windows keyboard or the Command key on a Mac. -- * `rgba_image_height` [number] -- The height for future RGBA image data. -- * `rgba_image_width` [number] @@ -552,20 +550,20 @@ module('buffer') -- Whether the maximum width line displayed is used to set scroll width. -- * `search_flags` [number] -- The search flags used by `buffer:search_in_target()`. --- * `_SCINTILLA.constants.SCFIND_WHOLEWORD` (2) --- A match only occurs with text that matches the case of the search --- string. --- * `_SCINTILLA.constants.SCFIND_MATCHCASE` (4) --- A match only occurs if the characters before and after are not word --- characters. --- * `_SCINTILLA.constants.SCFIND_WORDSTART` (0x00100000) --- A match only occurs if the character before is not a word character. --- * `_SCINTILLA.constants.SCFIND_REGEXP` (0x00200000) --- The search string should be interpreted as a regular expression. --- * `_SCINTILLA.constants.SCFIND_POSIX` (0x00400000) --- Treat regular expression in a more POSIX compatible manner by --- interpreting bare `(` and `)` for tagged sections rather than `\(` --- and `\)`. +-- * `_SCINTILLA.constants.SCFIND_WHOLEWORD` (2) +-- A match only occurs with text that matches the case of the search +-- string. +-- * `_SCINTILLA.constants.SCFIND_MATCHCASE` (4) +-- A match only occurs if the characters before and after are not word +-- characters. +-- * `_SCINTILLA.constants.SCFIND_WORDSTART` (0x00100000) +-- A match only occurs if the character before is not a word character. +-- * `_SCINTILLA.constants.SCFIND_REGEXP` (0x00200000) +-- The search string should be interpreted as a regular expression. +-- * `_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. @@ -581,14 +579,14 @@ module('buffer') -- The alternative is the more common stream selection. -- * `selection_mode` [number] -- The mode of the current selection. --- * `_SCINTILLA.constants.SC_SEL_STREAM` (0) --- Stream. --- * `_SCINTILLA.constants.SC_SEL_RECTANGLE` (1) --- Rectangle. --- * `_SCINTILLA.constants.SC_SEL_LINES` (2) --- Lines. --- * `_SCINTILLA.constants.SC_SEL_THIN` (3) --- Thin rectangular. +-- * `_SCINTILLA.constants.SC_SEL_STREAM` (0) +-- Stream. +-- * `_SCINTILLA.constants.SC_SEL_RECTANGLE` (1) +-- Rectangle. +-- * `_SCINTILLA.constants.SC_SEL_LINES` (2) +-- Lines. +-- * `_SCINTILLA.constants.SC_SEL_THIN` (3) +-- Thin rectangular. -- * `selection_n_anchor` [table] -- Table of anchor positions for existing selections starting from zero, the -- main selection. @@ -614,12 +612,12 @@ module('buffer') -- The number of selections currently active. -- * `status` [number] -- The error status. --- * `_SCINTILLA.constants.SC_STATUS_OK` (0) --- No failures. --- * `_SCINTILLA.constants.SC_STATUS_FAILURE` (1) --- Generic failure. --- * `_SCINTILLA.constants.SC_STATUS_BADALLOC` (2) --- Memory is exhausted. +-- * `_SCINTILLA.constants.SC_STATUS_OK` (0) +-- No failures. +-- * `_SCINTILLA.constants.SC_STATUS_FAILURE` (1) +-- Generic failure. +-- * `_SCINTILLA.constants.SC_STATUS_BADALLOC` (2) +-- Memory is exhausted. -- * `style_at` [table] (Read-only) -- Table of style bytes at positions in the document starting at zero. -- * `style_back` [table] @@ -633,12 +631,12 @@ module('buffer') -- Table of booleans for bold styles from `0` to `255`. -- * `style_case` [table] -- Table of cases for styles from `0` to `255`. --- * `_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. +-- * `_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 `0` to `255`. -- The default setting is `true`. @@ -672,12 +670,12 @@ module('buffer') -- with 1 being very light and 999 very heavy. While any value can be used, -- fonts often only support between 2 and 4 weights with three weights being -- common enough to use symbolic names: --- * `_SCINTILLA.constants.SC_WEIGHT_NORMAL` (400) --- Normal. --- * `_SCINTILLA.constants.SC_WEIGHT_SEMIBOLD` (600) --- Semi-bold. --- * `_SCINTILLA.constants.SC_WEIGHT_BOLD` (700) --- Bold. +-- * `_SCINTILLA.constants.SC_WEIGHT_NORMAL` (400) +-- Normal. +-- * `_SCINTILLA.constants.SC_WEIGHT_SEMIBOLD` (600) +-- Semi-bold. +-- * `_SCINTILLA.constants.SC_WEIGHT_BOLD` (700) +-- Bold. -- * `tab_indents` [bool] -- Whether a tab pressed when caret is within indentation indents. -- * `tab_width` [number] @@ -714,22 +712,22 @@ module('buffer') -- Normally, the end of line characters are hidden. -- * `view_ws` [number] -- The visibility of white space characters. --- * `_SCINTILLA.constants.SCWS_INVISIBLE` (0) --- The normal display mode with white space displayed as an empty --- background color. --- * `_SCINTILLA.constants.SCWS_VISIBLEALWAYS` (1) --- White space characters are drawn as dots and arrows. --- * `_SCINTILLA.constants.SCWS_VISIBLEAFTERINDENT` (2) --- White space used for indentation is displayed normally but after the --- first visible character, it is shown as dots and arrows. +-- * `_SCINTILLA.constants.SCWS_INVISIBLE` (0) +-- The normal display mode with white space displayed as an empty +-- background color. +-- * `_SCINTILLA.constants.SCWS_VISIBLEALWAYS` (1) +-- White space characters are drawn as dots and arrows. +-- * `_SCINTILLA.constants.SCWS_VISIBLEAFTERINDENT` (2) +-- White space used for indentation is displayed normally but after the +-- first visible character, it is shown as dots and arrows. -- * `virtual_space_options` [number] -- Virtual space options. --- * `_SCINTILLA.constants.SCVS_NONE` (0) --- Disables all use of virtual space (default). --- * `_SCINTILLA.constants.SCVS_RECTANGULARSELECTION` (1) --- Enabled only for rectangular selections. --- * `_SCINTILLA.constants.SCVS_USERACCESSIBLE` (2) --- Enabled. +-- * `_SCINTILLA.constants.SCVS_NONE` (0) +-- Disables all use of virtual space (default). +-- * `_SCINTILLA.constants.SCVS_RECTANGULARSELECTION` (1) +-- Enabled only for rectangular selections. +-- * `_SCINTILLA.constants.SCVS_USERACCESSIBLE` (2) +-- Enabled. -- * `whitespace_chars` [string] (Write-only) -- The set of characters making up whitespace for when moving or selecting by -- word. @@ -737,45 +735,45 @@ module('buffer') -- * `wrap_indent_mode` [number] -- How wrapped sublines are placed. -- Default is fixed. --- * `_SCINTILLA.constants.SC_WRAP_INDENT_FIXED` (0) --- Wrapped sublines aligned to left of window plus amount set by --- `buffer.wrap_start_indent`. --- * `_SCINTILLA.constants.SC_WRAP_INDENT_SAME` (1) --- Wrapped sublines are aligned to first subline indent. --- * `_SCINTILLA.constants.SC_WRAP_INDENT_INDENT` (2) --- Wrapped sublines are aligned to first subline indent plus one more --- level of indentation. +-- * `_SCINTILLA.constants.SC_WRAP_INDENT_FIXED` (0) +-- Wrapped sublines aligned to left of window plus amount set by +-- `buffer.wrap_start_indent`. +-- * `_SCINTILLA.constants.SC_WRAP_INDENT_SAME` (1) +-- Wrapped sublines are aligned to first subline indent. +-- * `_SCINTILLA.constants.SC_WRAP_INDENT_INDENT` (2) +-- Wrapped sublines are aligned to first subline indent plus one more +-- level of indentation. -- * `whitespace_size` [number] -- The size of the dots used to mark space characters. -- * `word_chars` [string] -- The set of characters making up words when moving or selecting by word. -- * `wrap_mode` [number] -- Text word wrap mode. --- * `_SCINTILLA.constants.SC_WRAP_NONE` (0) --- Disable line wrapping. --- * `_SCINTILLA.constants.SC_WRAP_WORD` (1) --- Enable wrapping on word boundaries. --- * `_SCINTILLA.constants.SC_WRAP_CHAR` (2) --- Enable wrapping between any characters. +-- * `_SCINTILLA.constants.SC_WRAP_NONE` (0) +-- Disable line wrapping. +-- * `_SCINTILLA.constants.SC_WRAP_WORD` (1) +-- Enable wrapping on word boundaries. +-- * `_SCINTILLA.constants.SC_WRAP_CHAR` (2) +-- Enable wrapping between any characters. -- * `wrap_start_indent` [number] -- The start indent for wrapped lines. -- * `wrap_visual_flags` [number] -- The display mode of visual flags for wrapped lines. --- * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_NONE` (0) --- No visual flags. --- * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_END` (1) --- Visual flag at end of subline of a wrapped line. --- * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_START` (2) --- Visual flag at begin of subline of a wrapped line. --- Subline is indented by at least 1 to make room for the flag. +-- * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_NONE` (0) +-- No visual flags. +-- * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_END` (1) +-- Visual flag at end of subline of a wrapped line. +-- * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_START` (2) +-- Visual flag at begin of subline of a wrapped line. +-- Subline is indented by at least 1 to make room for the flag. -- * `wrap_visual_flags_location` [number] -- The location of visual flags for wrapped lines. --- * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_DEFAULT` (0) --- Visual flags drawn near border. --- * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_END_BY_TEXT` (1) --- Visual 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. +-- * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_DEFAULT` (0) +-- Visual flags drawn near border. +-- * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_END_BY_TEXT` (1) +-- Visual 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 normal position with the first text column visible at @@ -784,7 +782,7 @@ module('buffer') -- The number of points added to the size of all fonts. -- It may be positive to magnify or negative to reduce. -- --- [string_iconv]: ../modules/string.html#iconv +-- [`string.iconv()`]: string.html#iconv --- -- Add a selection from anchor to caret as the main selection. diff --git a/core/args.lua b/core/args.lua index 0f383544..f0b0fcf2 100644 --- a/core/args.lua +++ b/core/args.lua @@ -10,8 +10,8 @@ module('args')]] -- Markdown: -- ## Arg Events -- --- + `'arg_none'`: Called when no command line arguments are passed to Textadept --- on init. +-- + `'arg_none'` +-- Called when no command line arguments are passed to Textadept on init. local arg = arg diff --git a/core/events.lua b/core/events.lua index c939e0db..02a1dcc5 100644 --- a/core/events.lua +++ b/core/events.lua @@ -36,7 +36,7 @@ module('events')]] -- -- * `APPLEEVENT_ODOC` -- Called when Mac OSX tells Textadept to open a document. --- * `uri`: The URI to open encoded in UTF-8. +-- * `uri`: The URI to open encoded in UTF-8. -- * `AUTO_C_CHAR_DELETED` -- Called when the user deleted a character while the autocompletion list was -- active. @@ -45,10 +45,11 @@ module('events')]] -- * `AUTO_C_SELECTION` -- Called when the user has selected an item in an autocompletion list and -- before the selection is inserted. --- Automatic insertion can be cancelled by calling `buffer:auto_c_cancel()` --- before returning from the event handler. Arguments: --- * `text`: The text of the selection. --- * `position`: The start position of the word being completed. +-- Automatic insertion can be cancelled by calling +-- [`buffer:auto_c_cancel()`][] before returning from the event handler. +-- Arguments: +-- * `text`: The text of the selection. +-- * `position`: The start position of the word being completed. -- * `BUFFER_AFTER_SWITCH` -- Called right after a buffer is switched to. -- * `BUFFER_BEFORE_SWITCH` @@ -60,134 +61,134 @@ module('events')]] -- * `CALL_TIP_CLICK` -- Called when the user clicks on a calltip. -- Arguments: --- * `position`: Set to 1 if the click is in an up arrow, 2 if in a down --- arrow, and 0 if elsewhere. +-- * `position`: Set to 1 if the click is in an up arrow, 2 if in a down +-- arrow, and 0 if elsewhere. -- * `CHAR_ADDED` -- Called when an ordinary text character is added to the buffer. -- Arguments: --- * `ch`: The text character byte. +-- * `ch`: The text character byte. -- * `COMMAND_ENTRY_COMMAND` -- Called when a command is entered into the Command Entry. -- Arguments: --- * `command`: The command text. +-- * `command`: The command text. -- * `COMMAND_ENTRY_KEYPRESS` -- Called when a key is pressed in the Command Entry. -- Arguments: --- * `code`: The key code. --- * `shift`: The Shift key is held down. --- * `ctrl`: The Control/Command key is held down. --- * `alt`: The Alt/option key is held down. --- * `meta`: The Control key on Mac OSX is held down. +-- * `code`: The key code. +-- * `shift`: The Shift key is held down. +-- * `ctrl`: The Control/Command key is held down. +-- * `alt`: The Alt/option key is held down. +-- * `meta`: The Control key on Mac OSX is held down. -- * `DOUBLE_CLICK` -- Called when the mouse button is double-clicked. -- Arguments: --- * `position`: The text position of the double click. --- * `line`: The line of the double click. --- * `modifiers`: The key modifiers held down. It is a combination of zero --- or more of `_SCINTILLA.constants.SCMOD_ALT`, --- `_SCINTILLA.constants.SCMOD_CTRL`, --- `_SCINTILLA.constants.SCMOD_SHIFT`, and --- `_SCINTILLA.constants.SCMOD_META`. --- Note: If you set `buffer.rectangular_selection_modifier` to --- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both* --- Ctrl and Alt due to a Scintilla limitation with GTK. +-- * `position`: The text position of the double click. +-- * `line`: The line of the double click. +-- * `modifiers`: The key modifiers held down. It is a combination of zero +-- or more of `_SCINTILLA.constants.SCMOD_ALT`, +-- `_SCINTILLA.constants.SCMOD_CTRL`, +-- `_SCINTILLA.constants.SCMOD_SHIFT`, and +-- `_SCINTILLA.constants.SCMOD_META`. +-- Note: If you set `buffer.rectangular_selection_modifier` to +-- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both* +-- Ctrl and Alt due to a Scintilla limitation with GTK. -- * `DWELL_END` -- Called after a `DWELL_START` and the mouse is moved or other activity such -- as key press indicates the dwell is over. -- Arguments: --- * `position`: The nearest position in the document to the position --- where the mouse pointer was lingering. --- * `x`: Where the pointer lingered. --- * `y`: Where the pointer lingered. +-- * `position`: The nearest position in the document to the position where +-- the mouse pointer was lingering. +-- * `x`: Where the pointer lingered. +-- * `y`: Where the pointer lingered. -- * `DWELL_START` -- Called when the user keeps the mouse in one position for the dwell period -- (see `_SCINTILLA.constants.SCI_SETMOUSEDWELLTIME`). -- Arguments: --- * `position`: The nearest position in the document to the position --- where the mouse pointer was lingering. --- * `x`: Where the pointer lingered. --- * `y`: Where the pointer lingered. +-- * `position`: The nearest position in the document to the position where +-- the mouse pointer was lingering. +-- * `x`: Where the pointer lingered. +-- * `y`: Where the pointer lingered. -- * `ERROR` -- Called when an error occurs. -- Arguments: --- * `text`: The error text. +-- * `text`: The error text. -- * `FIND` -- Called when finding text via the Find dialog box. -- Arguments: --- * `text`: The text to search for. --- * `next`: Search forward. +-- * `text`: The text to search for. +-- * `next`: Search forward. -- * `HOTSPOT_CLICK` -- Called when the user clicks on text that is in a style with the hotspot -- attribute set. -- Arguments: --- * `position`: The text position of the click. --- * `modifiers`: The key modifiers held down. It is a combination of zero --- or more of `_SCINTILLA.constants.SCMOD_ALT`, --- `_SCINTILLA.constants.SCMOD_CTRL`, --- `_SCINTILLA.constants.SCMOD_SHIFT`, and --- `_SCINTILLA.constants.SCMOD_META`. --- Note: If you set `buffer.rectangular_selection_modifier` to --- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both* --- Ctrl and Alt due to a Scintilla limitation with GTK. +-- * `position`: The text position of the click. +-- * `modifiers`: The key modifiers held down. It is a combination of zero +-- or more of `_SCINTILLA.constants.SCMOD_ALT`, +-- `_SCINTILLA.constants.SCMOD_CTRL`, +-- `_SCINTILLA.constants.SCMOD_SHIFT`, and +-- `_SCINTILLA.constants.SCMOD_META`. +-- Note: If you set `buffer.rectangular_selection_modifier` to +-- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both* +-- Ctrl and Alt due to a Scintilla limitation with GTK. -- * `HOTSPOT_DOUBLE_CLICK` -- Called when the user double clicks on text that is in a style with the -- hotspot attribute set. -- Arguments: --- * `position`: The text position of the double click. --- * `modifiers`: The key modifiers held down. It is a combination of zero --- or more of `_SCINTILLA.constants.SCMOD_ALT`, --- `_SCINTILLA.constants.SCMOD_CTRL`, --- `_SCINTILLA.constants.SCMOD_SHIFT`, and --- `_SCINTILLA.constants.SCMOD_META`. --- Note: If you set `buffer.rectangular_selection_modifier` to --- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both* --- Ctrl and Alt due to a Scintilla limitation with GTK. +-- * `position`: The text position of the double click. +-- * `modifiers`: The key modifiers held down. It is a combination of zero +-- or more of `_SCINTILLA.constants.SCMOD_ALT`, +-- `_SCINTILLA.constants.SCMOD_CTRL`, +-- `_SCINTILLA.constants.SCMOD_SHIFT`, and +-- `_SCINTILLA.constants.SCMOD_META`. +-- Note: If you set `buffer.rectangular_selection_modifier` to +-- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both* +-- Ctrl and Alt due to a Scintilla limitation with GTK. -- * `HOTSPOT_RELEASE_CLICK` -- Called when the user releases the mouse on text that is in a style with the -- hotspot attribute set. -- Arguments: --- * `position`: The text position of the release. +-- * `position`: The text position of the release. -- * `INDICATOR_CLICK` -- Called when the user clicks the mouse on text that has an indicator. -- Arguments: --- * `position`: The text position of the click. --- * `modifiers`: The key modifiers held down. It is a combination of zero --- or more of `_SCINTILLA.constants.SCMOD_ALT`, --- `_SCINTILLA.constants.SCMOD_CTRL`, --- `_SCINTILLA.constants.SCMOD_SHIFT`, and --- `_SCINTILLA.constants.SCMOD_META`. --- Note: If you set `buffer.rectangular_selection_modifier` to --- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both* --- Ctrl and Alt due to a Scintilla limitation with GTK. +-- * `position`: The text position of the click. +-- * `modifiers`: The key modifiers held down. It is a combination of zero +-- or more of `_SCINTILLA.constants.SCMOD_ALT`, +-- `_SCINTILLA.constants.SCMOD_CTRL`, +-- `_SCINTILLA.constants.SCMOD_SHIFT`, and +-- `_SCINTILLA.constants.SCMOD_META`. +-- Note: If you set `buffer.rectangular_selection_modifier` to +-- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both* +-- Ctrl and Alt due to a Scintilla limitation with GTK. -- * `INDICATOR_RELEASE` -- Called when the user releases the mouse on text that has an indicator. -- Arguments: --- * `position`: The text position of the release. +-- * `position`: The text position of the release. -- * `KEYPRESS` -- Called when a key is pressed. -- Arguments: --- * `code`: The key code. --- * `shift`: The Shift key is held down. --- * `ctrl`: The Control/Command key is held down. --- * `alt`: The Alt/option key is held down. --- * `meta`: The Control key on Mac OSX is held down. +-- * `code`: The key code. +-- * `shift`: The Shift key is held down. +-- * `ctrl`: The Control/Command key is held down. +-- * `alt`: The Alt/option key is held down. +-- * `meta`: The Control key on Mac OSX is held down. -- * `MARGIN_CLICK` -- Called when the mouse is clicked inside a margin. -- Arguments: --- * `margin`: The margin number that was clicked. --- * `position`: The position of the start of the line in the buffer that --- corresponds to the margin click. --- * `modifiers`: The appropriate combination of --- `_SCINTILLA.constants.SCI_SHIFT`, `_SCINTILLA.constants.SCI_CTRL`, --- and `_SCINTILLA.constants.SCI_ALT` to indicate the keys that were --- held down at the time of the margin click. --- Note: If you set `buffer.rectangular_selection_modifier` to --- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both* --- Ctrl and Alt due to a Scintilla limitation with GTK. +-- * `margin`: The margin number that was clicked. +-- * `position`: The position of the start of the line in the buffer that +-- corresponds to the margin click. +-- * `modifiers`: The appropriate combination of +-- `_SCINTILLA.constants.SCI_SHIFT`, `_SCINTILLA.constants.SCI_CTRL`, +-- and `_SCINTILLA.constants.SCI_ALT` to indicate the keys that were +-- held down at the time of the margin click. +-- Note: If you set `buffer.rectangular_selection_modifier` to +-- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both* +-- Ctrl and Alt due to a Scintilla limitation with GTK. -- * `MENU_CLICKED` -- Called when a menu item is selected. -- Arguments: --- * `menu_id`: The numeric ID of the menu item set in `gui.gtkmenu()`. +-- * `menu_id`: The numeric ID of the menu item set in [`gui.gtkmenu()`][]. -- * `QUIT` -- Called when quitting Textadept. -- When connecting to this event, connect with an index of 1 or the handler @@ -195,18 +196,18 @@ module('events')]] -- * `REPLACE` -- Called to replace selected (found) text. -- Arguments: --- * `text`: The text to replace selected text with. +-- * `text`: The text to replace selected text with. -- * `REPLACE_ALL` -- Called to replace all occurances of found text. -- Arguments: --- * `find_text`: The text to search for. --- * `repl_text`: The text to replace found text with. +-- * `find_text`: The text to search for. +-- * `repl_text`: The text to replace found text with. -- * `RESET_AFTER` -- Called after resetting the Lua state. --- This is triggered by `reset()`. +-- This is triggered by [`reset()`][]. -- * `RESET_BEFORE` -- Called before resetting the Lua state. --- This is triggered by `reset()`. +-- This is triggered by [`reset()`][]. -- * `SAVE_POINT_LEFT` -- Called when a save point is left. -- * `SAVE_POINT_REACHED` @@ -217,14 +218,14 @@ module('events')]] -- * `URI_DROPPED` -- Called when the user has dragged a URI such as a file name onto the view. -- Arguments: --- * `text`: The URI text encoded in UTF-8. +-- * `text`: The URI text encoded in UTF-8. -- * `USER_LIST_SELECTION` -- Called when the user has selected an item in a user list. -- Arguments: --- * `list_type`: This is set to the list_type parameter from the --- `buffer:user_list_show()` call that initiated the list. --- * `text`: The text of the selection. --- * `position`: The position the list was displayed at. +-- * `list_type`: This is set to the list_type parameter from the +-- [`buffer:user_list_show()`][] call that initiated the list. +-- * `text`: The text of the selection. +-- * `position`: The position the list was displayed at. -- * `VIEW_NEW` -- Called when a new view is created. -- * `VIEW_BEFORE_SWITCH` @@ -232,6 +233,11 @@ module('events')]] -- * `VIEW_AFTER_SWITCH` -- Called right after another view is switched to. -- +-- [`buffer:auto_c_cancel()`]: buffer.html#buffer.auto_c_cancel +-- [`gui.gtkmenu()`]: gui.html#gtkmenu +-- [`reset()`]: _G.html#reset +-- [`buffer:user_list_show()`]: buffer.html#buffer.user_list_show +-- -- ## Example -- -- The following Lua code generates and handles a custom `my_event` event: diff --git a/core/file_io.lua b/core/file_io.lua index 8ff6d5be..1d31f1e6 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -6,13 +6,14 @@ module('io')]] -- Markdown: --- ## Converting Filenames to and from UTF-8 +-- ## Working with UTF-8 -- -- If your filesystem does not use UTF-8 encoded filenames, conversions to and --- from that encoding will be necessary. When opening and saving files through --- dialogs, Textadept takes care of these conversions for you, but if you need --- to do them manually, use [`string.iconv()`][string_iconv] along with --- `_CHARSET`, your filesystem's detected encoding. +-- from that encoding are necessary since all of Textadept's internal strings +-- are UTF-8 encoded. When opening and saving files through dialogs, these +-- conversions are performed autmatically, but if you need to do them manually, +-- use [`string.iconv()`][] along with `_CHARSET`, your filesystem's detected +-- encoding. -- -- Example: -- @@ -23,26 +24,26 @@ module('io')]] -- f:close() -- end) -- --- [string_iconv]: ../modules/string.html#iconv +-- [`string.iconv()`]: string.html#iconv -- -- ## File Events -- -- * `_G.events.FILE_OPENED` -- Called when a file is opened in a new buffer. -- Arguments: --- * `filename`: The filename encoded in UTF-8. +-- * `filename`: The filename encoded in UTF-8. -- * `_G.events.FILE_BEFORE_SAVE` -- Called right before a file is saved to disk. -- Arguments: --- * `filename`: The filename encoded in UTF-8. +-- * `filename`: The filename encoded in UTF-8. -- * `_G.events.FILE_AFTER_SAVE` -- Called right after a file is saved to disk. -- Arguments: --- * `filename`: The filename encoded in UTF-8. +-- * `filename`: The filename encoded in UTF-8. -- * `_G.events.FILE_SAVED_AS` -- Called when a file is saved under a different filename. -- Arguments: --- * `filename`: The filename encoded in UTF-8. +-- * `filename`: The filename encoded in UTF-8. -- Events. local events, events_connect = events, events.connect diff --git a/core/init.lua b/core/init.lua index 056a212b..8f7fd360 100644 --- a/core/init.lua +++ b/core/init.lua @@ -30,23 +30,24 @@ module('_G')]] -- * `_HOME` [string] -- Path to the directory containing Textadept. -- * `_LEXERPATH` [string] --- Paths to lexers, formatted like [`package.path`][package_path]. +-- Paths to lexers, formatted like [`package.path`][]. -- * `_RELEASE` [string] -- The Textadept release version. -- * `_USERHOME` [string] -- Path to the user's `~/.textadept/`. -- * `_CHARSET` [string] -- The character set encoding of the filesystem. --- This is used in [File I/O](../modules/io.html). +-- This is used in [File I/O][]. -- * `RESETTING` [bool] --- If [`reset()`](../modules/_G.html#reset) has been called, this flag is --- `true` while the Lua state is being re-initialized. +-- If [`reset()`](#reset) has been called, this flag is `true` while the Lua +-- state is being re-initialized. -- * `WIN32` [bool] -- If Textadept is running on Windows, this flag is `true`. -- * `OSX` [bool] -- If Textadept is running on Mac OSX, this flag is `true`. -- --- [package_path]: http://www.lua.org/manual/5.1/manual.html#pdf-package.path +-- [`package.path`]: http://www.lua.org/manual/5.2/manual.html#pdf-package.path +-- [File I/O]: io.html --- -- Calls `dofile()` on the given filename in the user's Textadept directory. diff --git a/core/keys.lua b/core/keys.lua index 90d677ab..6418b612 100644 --- a/core/keys.lua +++ b/core/keys.lua @@ -34,17 +34,20 @@ module('keys')]] -- ADD = '+' -- -- pressing control, alt, shift, and 'a' yields: 'Ctrl+Alt+Shift+A' -- --- For key values less than 255, Lua's [`string.char()`][string_char] is used to --- determine the key's string representation. Otherwise, the --- [`KEYSYMS`](../modules/_M.textadept.keys.html#KEYSYMS) lookup table is used. +-- For key values less than 255, Lua's [`string.char()`][] is used to determine +-- the key's string representation. Otherwise, the [`KEYSYMS`](#KEYSYMS) lookup +-- table is used. -- --- [string_char]: http://www.lua.org/manual/5.1/manual.html#pdf-string.char +-- [`string.char()`]: http://www.lua.org/manual/5.2/manual.html#pdf-string.char -- -- Normally, Lua functions are assigned to key commands, but those functions are -- called without any arguments. In order to pass arguments to a function, -- assign a table to the key command. This table contains the function followed --- by its arguments in order. Any [buffer](../modules/buffer.html) or --- [view](../modules/view.html) references are handled correctly at runtime. +-- by its arguments in order. Any [buffer][] or [view][] references are handled +-- correctly at runtime. +-- +-- [buffer]: buffer.html +-- [view]: view.html -- -- Key commands can be chained like in Emacs using keychain sequences. By -- default, the `Esc` key (`Apple+Esc` on Mac OSX) cancels the current keychain, @@ -77,12 +80,12 @@ module('keys')]] -- modules. -- The default value is Ctrl/Cmd+L. -- --- ## Key Command Precedence +-- ## Precedence -- -- When searching for a key command to execute in the `keys` table, key commands -- in the current lexer have priority, followed by the ones in the global table. -- --- #### Propagation +-- ### Propagation -- -- Normally when the same key command is assigned to two separate functions of -- different precedence, the higher priority key command is run and the lower diff --git a/core/locale.lua b/core/locale.lua index 5448cdc4..a89685ed 100644 --- a/core/locale.lua +++ b/core/locale.lua @@ -8,7 +8,7 @@ local M = {} module('_L')]] -- Markdown: --- # Settings +-- ## Settings -- -- * `_NIL` [string] -- String returned when no localization for a given message exists. @@ -26,10 +26,4 @@ for line in f:lines() do end f:close() ---- --- This table contains no functions. --- @class function --- @name no_functions -local no_functions - return setmetatable(M, { __index = function() return M._NIL end }) |