From 03b0b8932ea1c41854a487f9fa6555def9b59462 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 30 Jun 2014 13:06:25 -0400 Subject: Condensed manual and API documentation into single files. --- core/._M.luadoc | 51 +++++--------- core/.buffer.luadoc | 190 ++++++++++++++++++++++++---------------------------- core/.view.luadoc | 10 +-- core/args.lua | 2 +- core/events.lua | 42 +++++------- core/file_io.lua | 8 +-- core/init.lua | 10 +-- core/keys.lua | 15 ++--- core/lfs_ext.lua | 4 +- core/ui.lua | 19 +++--- 10 files changed, 152 insertions(+), 199 deletions(-) (limited to 'core') diff --git a/core/._M.luadoc b/core/._M.luadoc index 18df50d9..673597eb 100644 --- a/core/._M.luadoc +++ b/core/._M.luadoc @@ -28,35 +28,30 @@ -- The `Ctrl+Shift+R` and `Ctrl+R` (`⌘⇧R` and `⌘R` on Mac OSX | `M-^R` and `^R` -- in curses) key bindings compile and run code, respectively. If Textadept does -- not execute the correct commands for your language, modify them in the --- [`textadept.run.compile_commands`][] and [`textadept.run.run_commands`][] --- tables using the appropriate lexer key. Commands may contain [macros][]. For --- Lua, it would look like +-- [`textadept.run.compile_commands`]() and [`textadept.run.run_commands`]() +-- tables using the appropriate lexer key. Commands may contain macros. For Lua, +-- it would look like: -- --- textadept.run.compile_commands.lua = 'luac "%(filename)"' --- textadept.run.run_commands.lua = 'lua "%(filename)"' +-- textadept.run.compile_commands.lua = 'luac "%f"' +-- textadept.run.run_commands.lua = 'lua "%f"' -- -- Double-clicking on compile or runtime errors jumps to the error's location. -- If Textadept does not recognize your language's errors properly, add an error --- pattern to [`textadept.run.error_patterns`][]. The Lua error pattern looks +-- pattern to [`textadept.run.error_patterns`](). The Lua error pattern looks -- like -- -- table.insert(textadept.run.error_patterns, 1, -- '^luac?: (.-):(%d+): (.+)$') -- --- [`textadept.run.compile_commands`]: textadept.run.html#compile_commands --- [`textadept.run.run_commands`]: textadept.run.html#run_commands --- [macros]: textadept.run.html#execute --- [`textadept.run.error_patterns`]: textadept.run.html#error_patterns --- -- #### Build a Project -- -- The `Ctrl+Shift+B` (`⌘⇧B` on Mac OSX | `M-^B` in curses) key bindings build -- the current project. Textadept can only detect projects under version --- control, and uses [`io.get_project_root()`][] to do so. The editor looks in +-- control, and uses [`io.get_project_root()`]() to do so. The editor looks in -- the detected project's root directory for some sort of "makefile" (GNU -- Makefiles, Ruby Rakefiles, etc.) and prompts the user for any additional -- arguments to pass to that makefile's run command. Textadept references --- [`textadept.run.build_commands`][] for makefiles and their associated run +-- [`textadept.run.build_commands`]() for makefiles and their associated run -- commands. Per-project build commands may also be defined. For example, the -- following command builds Textadept after prompting for makefile targets: -- @@ -69,8 +64,6 @@ -- -- As with compile and run commands, any recognized errors are flagged. -- --- [`io.get_project_root()`]: io.html#get_project_root --- [`textadept.run.build_commands`]: textadept.run.html#build_commands -- -- #### Buffer Properties -- @@ -90,15 +83,14 @@ -- The `Ctrl+Space` and `Ctrl+H` (`⌥⎋` and `^H` on Mac OSX | `^Space` and `M-H` -- or `M-S-H` in curses) key bindings autocomplete symbols and show API -- documentation, respectively, when editing code. In order for these to work --- for your language, you must create an [autocompleter][] and [API file(s)][]. --- --- [autocompleter]: textadept.editing.html#autocompleters --- [API file(s)]: textadept.editing.html#api_files +-- for your language, you must create an +-- [autocompleter](#textadept.editing.autocompleters) and +-- [API file(s)](#textadept.editing.api_files). -- -- #### Snippets -- --- [Snippets][] for common language constructs are useful. Some snippets for --- common Lua control structures look like +-- [Snippets](#textadept.snippets) for common language constructs are useful. +-- Some snippets for common Lua control structures look like -- -- snippets.lua = { -- f = "function %1(name)(%2(args))\n\t%0\nend", @@ -107,15 +99,13 @@ -- forp = "for %1(k), %2(v) in pairs(%3(table)) do\n\t%0\nend", -- } -- --- [Snippets]: textadept.snippets.html --- -- #### Commands -- -- Additional editing features for the language can be useful. For example, the --- [Lua][] module has a feature to autocomplete the `end` keyword in a control --- structure and the [C/C++][] module has a feature to add a ';' to the end of --- the current line and insert a new line. Both are bound to the `Shift+Enter` --- (`⇧↩` on Mac OSX | `S-Enter` in curses) key for easy access. +-- [Lua](#_M.lua) module has a feature to autocomplete the `end` keyword in a +-- control structure and the [C](#_M.ansi_c) module has a feature to add a ';' +-- to the end of the current line and insert a new line. Both are bound to the +-- `Shift+Enter` (`⇧↩` on Mac OSX | `S-Enter` in curses) key for easy access. -- -- -- In file *lua/init.lua* | -- In file *cpp/init.lua* -- | @@ -127,12 +117,9 @@ -- ['s\n'] = M.try_to_autocomplete_end | end -- } | } -- --- [Lua]: _M.lua.html --- [C/C++]: _M.cpp.html --- -- #### Context Menu -- --- Language-specific [context menus][], accessible by right-clicking inside the +-- Language-specific context menus, accessible by right-clicking inside the -- view, are useful for accessing module features without using key bindings. -- For Lua this might look like -- @@ -149,6 +136,4 @@ -- {''}, -- {'Autocomplete "end"', M.try_to_autocomplete_end} -- } --- --- [context menus]: textadept.menu.html#context_menu module('_M')]] diff --git a/core/.buffer.luadoc b/core/.buffer.luadoc index 298411d8..0f6874cd 100644 --- a/core/.buffer.luadoc +++ b/core/.buffer.luadoc @@ -20,10 +20,10 @@ -- The default value is `buffer.ALPHA_NOALPHA`, for no alpha. -- @field additional_sel_back (number, Write-only) -- The background color, in "0xBBGGRR" format, of additional selections. --- This field has no effect when calling `buffer:set_sel_back(false, ...)`. +-- This field has no effect when calling `buffer.set_sel_back(false, ...)`. -- @field additional_sel_fore (number, Write-only) -- The foreground color, in "0xBBGGRR" format, of additional selections. --- This field has no effect when calling `buffer:set_sel_fore(false, ...)`. +-- This field has no effect when calling `buffer.set_sel_fore(false, ...)`. -- @field additional_selection_typing (bool) -- Type into multiple selections. -- The default value is `false`. @@ -41,8 +41,7 @@ -- size/size_fractional, bold/weight, italics, fore, back, and character_set. -- @field annotation_style_offset (number) -- The beginning of the range of style numbers used for annotations. --- Always set this to the result of --- [`buffer.allocate_extended_styles`](#allocate_extended_styles). +-- Always set this to the result of [`buffer.allocate_extended_styles()`](). -- Annotation styles may be completely separated from standard text styles by -- setting a style offset. For example, when set to `512`, annotation styles -- are numbered from `512` upto `767` so they do not overlap styles set by @@ -74,7 +73,7 @@ -- The default value is `true`. -- @field auto_c_case_insensitive_behaviour (number) -- The behavior mode for a case insensitive autocompletion or user list when --- [`buffer.auto_c_ignore_case`](#auto_c_ignore_case) is `true`. +-- [`buffer.auto_c_ignore_case`]() is `true`. -- -- * `buffer.CASEINSENSITIVEBEHAVIOUR_RESPECTCASE` -- Prefer to select case-sensitive matches. @@ -121,13 +120,12 @@ -- The order setting for autocompletion and user lists. -- -- * `buffer.ORDER_PRESORTED` --- Lists passed to [`buffer.auto_c_show`](#auto_c_show) are in sorted, --- alphabetical order. +-- Lists passed to [`buffer.auto_c_show()`]() are in sorted, alphabetical +-- order. -- * `buffer.ORDER_PERFORMSORT` --- Sort autocompletion lists passed to [`buffer.auto_c_show`](#auto_c_show). +-- Sort autocompletion lists passed to [`buffer.auto_c_show()`](). -- * `buffer.ORDER_CUSTOM` --- Lists passed to [`buffer.auto_c_show`](#auto_c_show) are already in a --- custom order. +-- Lists passed to [`buffer.auto_c_show()`]() are already in a custom order. -- -- The default value is `buffer.ORDER_PRESORTED`. -- @field auto_c_separator (number) @@ -138,10 +136,9 @@ -- The character byte that separates autocompletion and user list items and -- their image types. -- Autocompletion and user list items can display both an image and text. --- Register images and their types using --- [`buffer:register_image()`](#register_image) or --- [`buffer:register_rgba_image()`](#register_rgba_image) before appending --- image types to list items after type separator characters. +-- Register images and their types using [`buffer.register_image()`]() or +-- [`buffer.register_rgba_image()`]() before appending image types to list +-- items after type separator characters. -- The default value is 63 ('?'). -- @field back_space_un_indents (bool) -- Un-indent text when backspacing within indentation. @@ -154,9 +151,9 @@ -- @field call_tip_fore_hlt (number, Write-only) -- A call tip's highlighted text foreground color, in "0xBBGGRR" format. -- @field call_tip_pos_start (number, Write-only) --- The position to display a call tip at with --- [`buffer.call_tip_show()`](#call_tip_show). When a call tip is visible, --- this is the position where backspacing beyond it hides the call tip. +-- The position to display a call tip at with [`buffer.call_tip_show()`](). +-- When a call tip is visible, this is the position where backspacing beyond +-- it hides the call tip. -- @field call_tip_position (boolean) -- Display a call tip above the current line instead of below it. -- The default value is `false`. @@ -245,12 +242,11 @@ -- * `buffer.EDGE_NONE` -- Long lines are not marked. -- * `buffer.EDGE_LINE` --- Draw a vertical line whose color is [`buffer.edge_colour`](#edge_colour) --- at column [`buffer.edge_column`](#edge_column). +-- Draw a vertical line whose color is [`buffer.edge_colour`]() at column +-- [`buffer.edge_column`](). -- * `buffer.EDGE_BACKGROUND` --- Change the background color of text after column --- [`buffer.edge_column`](#edge_column) to --- [`buffer.edge_colour`](#edge_colour). +-- Change the background color of text after column [`buffer.edge_column`]() +-- to [`buffer.edge_colour`](). -- @field encoding (string or nil) -- The string encoding of the file, or `nil` for binary files. -- @field encoding_bom (string) @@ -264,7 +260,7 @@ -- @field eol_mode (number) -- The current end of line mode. Changing the current mode does not convert -- any of the buffer's existing end of line characters. --- Use [`buffer:convert_eols()`](#convert_eols) to do so. +-- Use [`buffer.convert_eols()`]() to do so. -- -- * `buffer.EOL_CRLF` -- Carriage return with line feed ("\r\n"). @@ -289,7 +285,7 @@ -- Table of flags that indicate whether or not fold points are expanded for -- line numbers starting from zero. -- Setting expanded fold states does not toggle folds; it only updates fold --- margin markers. Use [`buffer:toggle_fold()`](#toggle_fold) instead. +-- margin markers. Use [`buffer.toggle_fold()`]() instead. -- @field fold_flags (number) -- Bit-mask of folding lines to draw in the buffer. -- @@ -337,8 +333,7 @@ -- The default value is `true`. -- @field indent (number) -- The number of spaces in one level of indentation. --- The default value is `0`, which uses the value of --- [`buffer.tab_width`](#tab_width). +-- The default value is `0`, which uses the value of [`buffer.tab_width`](). -- @field indentation_guides (number) -- The indentation guide drawing mode. -- Indentation guides are dotted vertical lines that appear within indentation @@ -389,10 +384,9 @@ -- A bounding box. -- * `buffer.INDIC_ROUNDBOX` -- A translucent box with rounded corners around the text. Use --- [`buffer.indic_alpha`](#indic_alpha) and --- [`buffer.indic_outline_alpha`](#indic_outline_alpha) to set the fill and --- outline transparency, respectively. Their default values are `30` and --- `50`. +-- [`buffer.indic_alpha`]() and [`buffer.indic_outline_alpha`]() to set the +-- fill and outline transparency, respectively. Their default values are +-- `30` and `50`. -- * `buffer.INDIC_STRAIGHTBOX` -- Similar to `INDIC_ROUNDBOX` but with sharp corners. -- * `buffer.INDIC_DASH` @@ -403,9 +397,8 @@ -- A squiggly underline 2 pixels in height. -- * `buffer.INDIC_DOTBOX` -- Similar to `INDIC_STRAIGHTBOX` but with a dotted outline. --- Translucency alternates between [`buffer.indic_alpha`](#indic_alpha) and --- [`buffer.indic_outline_alpha`](#indic_outline_alpha) starting with the --- top-left pixel. +-- Translucency alternates between [`buffer.indic_alpha`]() and +-- [`buffer.indic_outline_alpha`]() starting with the top-left pixel. -- * `buffer.INDIC_SQUIGGLEPIXMAP` -- Identical to `INDIC_SQUIGGLE` but draws faster by using a pixmap instead -- of multiple line segments. @@ -414,19 +407,16 @@ -- on either side. Similar in appearance to Asian language input -- composition. -- --- Use [`_SCINTILLA.next_indic_number()`][] for custom indicators. --- --- [`_SCINTILLA.next_indic_number()`]: _SCINTILLA.html#next_indic_number +-- Use [`_SCINTILLA.next_indic_number()`]() for custom indicators. -- @field indic_under (table) -- Table of flags that indicate whether or not to draw indicators behind text -- instead of over the top of it for indicator numbers from `0` to `31`. --- For values to be `true`, [`buffer.two_phase_draw`](#two_phase_draw) must be --- `true`. +-- For values to be `true`, [`buffer.two_phase_draw`]() must be `true`. -- The default values are `false`. -- @field indicator_current (number) -- The indicator number in the range of `0` to `31` used by --- [`buffer:indicator_fill_range()`](#indicator_fill_range) and --- [`buffer:indicator_clear_range()`](#indicator_clear_range). +-- [`buffer.indicator_fill_range()`]() and +-- [`buffer.indicator_clear_range()`](). -- @field length (number, Read-only) -- The number of bytes in the buffer. -- @field line_count (number, Read-only) @@ -496,8 +486,7 @@ -- italics, fore, and back. -- @field margin_style_offset (number) -- The beginning of the range of style numbers used for margin text. --- Always set this to the result of --- [`buffer.allocate_extended_styles`](#allocate_extended_styles). +-- Always set this to the result of [`buffer.allocate_extended_styles()`](). -- Margin styles may be completely separated from standard text styles by -- setting a style offset. For example, when set to `256`, margin styles are -- numbered from `256` upto `511` so they do not overlap styles set by lexers. @@ -550,7 +539,7 @@ -- `DWELL_START` event. A time of `buffer.TIME_FOREVER` will never generate -- one. -- @field mouse_selection_rectangular_switch (bool) --- Whether or not pressing `buffer.rectangular_selection_modifier` during +-- Whether or not pressing [`buffer.rectangular_selection_modifier`]() during -- normal text selection with the mouse turns on rectangular selection. -- The default value is `false`. -- @field modify (bool) @@ -580,7 +569,7 @@ -- or `0` if not found. -- @field punctuation_chars (string) -- The string set of characters recognized as punctuation characters. --- Set this only after setting [`buffer.word_chars`](#word_chars). +-- Set this only after setting [`buffer.word_chars`](). -- The default value is a string that contains all non-word and non-whitespace -- characters. -- @field read_only (bool) @@ -611,37 +600,34 @@ -- The alternative string representations of characters. -- Representations are displayed in the same way control characters are. Use -- the empty string for the '\0' character when assigning its representation. --- Call [`buffer:clear_representation()`](#clear_representation) to remove a --- representation. +-- Call [`buffer.clear_representation()`]() to remove a representation. -- @field rgba_image_height (number) -- The height of the RGBA image to be defined using --- [`buffer:marker_define_rgba_image()`](#marker_define_rgba_image). +-- [`buffer.marker_define_rgba_image()`](). -- @field rgba_image_scale (number) -- The scale factor in percent of the RGBA image to be defined using --- [`buffer:marker_define_rgba_image()`](#marker_define_rgba_image). +-- [`buffer.marker_define_rgba_image()`](). -- This is useful on OSX with a retina display where each display unit is 2 -- pixels: use a factor of `200` so that each image pixel is displayed using a -- screen pixel. The default scale, `100`, will stretch each image pixel to -- cover 4 screen pixels on a retina display. -- @field rgba_image_width (number) -- The width of the RGBA image to be defined using --- [`buffer:marker_define_rgba_image()`](#marker_define_rgba_image) and --- [`buffer:register_rgba_image()`](#register_rgba_image). +-- [`buffer.marker_define_rgba_image()`]() and +-- [`buffer.register_rgba_image()`](). -- @field scroll_width (number) -- The horizontal scrolling pixel width. -- For performance, the view does not measure the display width of the buffer -- to determine the properties of the horizontal scroll bar, but uses an -- assumed width instead. To ensure the width of the currently visible lines --- can be scrolled use --- [`buffer.scroll_width_tracking`](#scroll_width_tracking). +-- can be scrolled use [`buffer.scroll_width_tracking`](). -- The default value is `2000`. -- @field scroll_width_tracking (bool) -- Continuously update the horizontal scrolling width to match the maximum --- width of a displayed line beyond [`buffer.scroll_width`](#scroll_width). +-- width of a displayed line beyond [`buffer.scroll_width`](). -- The default value is `false`. -- @field search_flags (number) --- The bit-mask of search flags used by --- [`buffer:search_in_target()`](#search_in_target). +-- The bit-mask of search flags used by [`buffer.search_in_target()`](). -- -- * `buffer.FIND_WHOLEWORD` -- Match search text only when it is surrounded by non-word characters. @@ -714,7 +700,7 @@ -- selected. -- -- When set, caret movement alters the selected text until this field is set --- again to the same value or until [`buffer:cancel()`](#cancel) is called. +-- again to the same value or until [`buffer.cancel()`]() is called. -- @field selection_n_anchor (table) -- Table of positions at the beginning of existing selections numbered from -- zero, the main selection. @@ -806,12 +792,10 @@ -- List of capture text for capture numbers from a regular expression search. -- @field target_end (number) -- The position of the end of the target range. --- This is also set by a successful --- [`buffer:search_in_target()`](#search_in_target). +-- This is also set by a successful [`buffer.search_in_target()`](). -- @field target_start (number) -- The position of the beginning of the target range. --- This is also set by a successful --- [`buffer:search_in_target()`](#search_in_target). +-- This is also set by a successful [`buffer.search_in_target()`](). -- @field text_length (number, Read-only) -- The number of bytes in the buffer. -- @field two_phase_draw (bool) @@ -819,17 +803,14 @@ -- The default value is `true`. -- @field undo_collection (bool) -- Collect undo information. --- When setting to `false`, call --- [`buffer:empty_undo_buffer()`](#empty_undo_buffer) to synchronize the undo --- buffer with the buffer text. +-- When setting to `false`, call [`buffer.empty_undo_buffer()`]() to +-- synchronize the undo buffer with the buffer text. -- The default value is `true`. -- @field use_tabs (bool) -- Use tabs instead of spaces in indentation. Changing the current setting -- does not convert any of the buffer's existing indentation. Use --- [`textadept.editing.convert_indentation()`][] to do so. +-- [`textadept.editing.convert_indentation()`]() to do so. -- The default value is `true`. --- --- [`textadept.editing.convert_indentation()`]: textadept.editing.html#convert_indentation -- @field v_scroll_bar (bool) -- Display the vertical scroll bar. -- The default value is `true`. @@ -862,7 +843,7 @@ -- The default value is `buffer.VS_NONE`. -- @field whitespace_chars (string) -- The string set of characters recognized as whitespace characters. --- Set this only after setting [`buffer.word_chars`](#word_chars). +-- Set this only after setting [`buffer.word_chars`](). -- The default value is a string that contains all non-newline characters less -- than ASCII value 33. -- @field whitespace_size (number) @@ -877,7 +858,7 @@ -- The wrapped line indent mode. -- -- * `buffer.WRAPINDENT_FIXED` --- Indent wrapped lines by [`buffer.wrap_start_indent`](#wrap_start_indent). +-- Indent wrapped lines by [`buffer.wrap_start_indent`](). -- * `buffer.WRAPINDENT_SAME` -- Indent wrapped lines the same amount as the first line. -- * `buffer.WRAPINDENT_INDENT` @@ -899,8 +880,7 @@ -- The default value is `buffer.WRAP_NONE`. -- @field wrap_start_indent (number) -- The number of spaces of indentation to display wrapped lines with if --- [`buffer.wrap_indent_mode`](#wrap_indent_mode) is --- `buffer.WRAP_INDENT_FIXED`. +-- [`buffer.wrap_indent_mode`]() is `buffer.WRAP_INDENT_FIXED`. -- The default value is `0`. -- @field wrap_visual_flags (number) -- The wrapped line visual flag display mode. @@ -1284,11 +1264,12 @@ module('buffer') -- Selects the range of text between positions *start_pos* to *end_pos* as the -- main selection, retaining all other selections as additional selections. -- Since an empty selection still counts as a selection, use --- `buffer:set_selection()` first when setting a list of selections. +-- `buffer.set_selection()` first when setting a list of selections. -- @param buffer A buffer. -- @param end_pos The caret position of the range of text to select in *buffer*. -- @param start_pos The anchor position of the range of text to select in -- *buffer*. +-- @see set_selection function add_selection(buffer, end_pos, start_pos) end --- @@ -1363,6 +1344,8 @@ function auto_c_select(buffer, prefix) end -- the context. -- @param items The sorted string of words to show, separated by -- `buffer.auto_c_separator` characters (initially spaces). +-- @see auto_c_separator +-- @see auto_c_order function auto_c_show(buffer, len_entered, items) end --- @@ -1543,8 +1526,8 @@ function clear_all(buffer) end function clear_document_style(buffer) end --- --- Clears all images registered using `buffer:register_image()` and --- `buffer:register_rgba_image()`. +-- Clears all images registered using `buffer.register_image()` and +-- `buffer.register_rgba_image()`. -- @param buffer A buffer. function clear_registered_images(buffer) end @@ -1749,7 +1732,7 @@ function ensure_visible(buffer, line) end --- -- Ensures line number *line* is visible by expanding any fold points hiding it -- based on the vertical caret policy previously defined in --- `buffer:set_visible_policy()`. +-- `buffer.set_visible_policy()`. -- @param buffer A buffer. -- @param line The line number in *buffer* to ensure visible. function ensure_visible_enforce_policy(buffer, line) end @@ -1927,7 +1910,7 @@ function home_rect_extend(buffer) end function home_wrap(buffer) end --- --- Like `buffer:home_wrap()`, but extends the selected text to the new position. +-- Like `buffer.home_wrap()`, but extends the selected text to the new position. -- @param buffer A buffer. function home_wrap_extend(buffer) end @@ -2060,7 +2043,7 @@ function line_end_rect_extend(buffer) end function line_end_wrap(buffer) end --- --- Like `buffer:line_end_wrap()`, but extends the selected text to the new +-- Like `buffer.line_end_wrap()`, but extends the selected text to the new -- position. -- @param buffer A buffer. function line_end_wrap_extend(buffer) end @@ -2078,7 +2061,7 @@ function line_from_position(buffer, pos) end -- Returns the number of bytes on line number *line*, including end of line -- characters. -- To get line length excluding end of line characters, use --- `buffer.line_end_position[line] - buffer:position_from_line(line)`. +-- `buffer.line_end_position[line] - buffer.position_from_line(line)`. -- @param buffer A buffer. -- @param line The line number in *buffer* to get the length of. -- @return number @@ -2151,7 +2134,7 @@ function margin_text_clear_all(buffer) end --- -- Adds marker number *marker*, in the range of `0` to `31`, to line number -- *line*, returning the added marker's handle which can be used in --- `buffer:marker_delete_handle()` and `buffer:marker_line_from_handle()`, or +-- `buffer.marker_delete_handle()` and `buffer.marker_line_from_handle()`, or -- `0` if *line* is invalid. -- @param buffer A buffer. -- @param line The line number to add the marker on. @@ -2234,9 +2217,9 @@ function marker_delete(buffer, line, marker) end function marker_delete_all(buffer, marker) end --- --- Deletes the marker with handle *handle* returned by `buffer:marker_add()`. +-- Deletes the marker with handle *handle* returned by `buffer.marker_add()`. -- @param buffer A 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 marker_delete_handle(buffer, handle) end --- @@ -2258,9 +2241,9 @@ function marker_get(buffer, line) end --- -- Returns the line number that marker handle *handle*, returned by --- `buffer:marker_add()`, was added to, or `-1` if the line was not found. +-- `buffer.marker_add()`, was added to, or `-1` if the line was not found. -- @param buffer A 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 marker_line_from_handle(buffer, handle) end @@ -2290,8 +2273,8 @@ function marker_previous(buffer, line, marker_mask) end --- -- Returns the symbol assigned to marker number *marker*, in the range of `0` to --- `31`, used in `buffer:marker_define()`, --- `buffer:marker_define_pixmap()`, or `buffer:marker_define_rgba_image()`. +-- `31`, used in `buffer.marker_define()`, +-- `buffer.marker_define_pixmap()`, or `buffer.marker_define_rgba_image()`. -- @param buffer A buffer. -- @param marker The marker number in the range of `0` to `31` to get the symbol -- of. @@ -2314,8 +2297,7 @@ function move_selected_lines_down(buffer) end function move_selected_lines_up(buffer) end --- --- Types a new line at the caret position according to --- [`buffer.eol_mode`](#eol_mode). +-- Types a new line at the caret position according to [`buffer.eol_mode`](). -- @param buffer A buffer. function new_line(buffer) end @@ -2432,7 +2414,7 @@ function redo(buffer) end -- autocompletion and user lists. -- @param buffer A buffer. -- @param type Integer type to register the image with. --- @param xpm_data The XPM data as described in `buffer:marker_define_pixmap()`. +-- @param xpm_data The XPM data as described in `buffer.marker_define_pixmap()`. function register_image(buffer, type, xpm_data) end --- @@ -2445,11 +2427,11 @@ function register_image(buffer, type, xpm_data) end -- @param buffer A buffer. -- @param type Integer type to register the image with. -- @param pixels The RGBA data as described in --- `buffer:marker_define_rgba_image()`. +-- `buffer.marker_define_rgba_image()`. function register_rgba_image(buffer, type, pixels) end --- --- Releases all styles allocated with `buffer:allocate_extended_styles()`. +-- Releases all styles allocated with `buffer.allocate_extended_styles()`. -- @param buffer A buffer. -- @see allocate_extended_styles function release_all_extended_styles(buffer) end @@ -2487,7 +2469,7 @@ function rotate_selection(buffer) end --- -- Scrolls the caret into view based on the policies previously defined in --- `buffer:set_x_caret_policy()` and `buffer:set_y_caret_policy()`. +-- `buffer.set_x_caret_policy()` and `buffer.set_y_caret_policy()`. -- @param buffer A buffer. -- @see set_x_caret_policy -- @see set_y_caret_policy @@ -2496,7 +2478,7 @@ function scroll_caret(buffer) end --- -- Scrolls into view the range of text between positions *primary_pos* and -- *secondary_pos*, with priority given to *primary_pos*. --- Similar to `buffer:scroll_caret()`, but with *primary_pos* instead of +-- Similar to `buffer.scroll_caret()`, but with *primary_pos* instead of -- `buffer.current_pos`. -- This is useful for scrolling search results into view. -- @param buffer A buffer. @@ -2515,7 +2497,7 @@ function scroll_to_end(buffer) end function scroll_to_start(buffer) end --- --- Anchors the position that `buffer:search_next()` and `buffer:search_prev()` +-- Anchors the position that `buffer.search_next()` and `buffer.search_prev()` -- start at to the caret position. -- @param buffer A buffer. function search_anchor(buffer) end @@ -2675,8 +2657,8 @@ function set_text(buffer, text) end --- -- Defines scrolling policy bit-mask *policy* as the policy for keeping the -- caret *y* number of lines away from the vertical margins as --- `buffer:ensure_visible_enforce_policy()` redisplays hidden or folded lines. --- It is similar in operation to `buffer:set_y_caret_policy()`. +-- `buffer.ensure_visible_enforce_policy()` redisplays hidden or folded lines. +-- It is similar in operation to `buffer.set_y_caret_policy()`. -- @param buffer A buffer. -- @param policy The combination of `buffer.VISIBLE_SLOP` and -- `buffer.VISIBLE_STRICT` policy flags to set. @@ -2728,7 +2710,7 @@ function show_lines(buffer, start_line, end_line) end --- -- Begins styling at position *position* with styling bit-mask *styling_mask*. -- *styling_mask* specifies which style bits can be set with --- `buffer:set_styling()`. +-- `buffer.set_styling()`. -- @param buffer A buffer. -- @param position The position in *buffer* to start styling at. -- @param styling_mask The bit mask of style bits that can be set when styling. @@ -2742,7 +2724,7 @@ function start_styling(buffer, position, style_mask) end function stuttered_page_down(buffer) end --- --- Like `buffer:stuttered_page_down()`, but extends the selected text to the new +-- Like `buffer.stuttered_page_down()`, but extends the selected text to the new -- position. -- @param buffer A buffer. function stuttered_page_down_extend(buffer) end @@ -2753,7 +2735,7 @@ function stuttered_page_down_extend(buffer) end function stuttered_page_up(buffer) end --- --- Like `buffer:stuttered_page_up()`, but extends the selected text to the new +-- Like `buffer.stuttered_page_up()`, but extends the selected text to the new -- position. -- @param buffer A buffer. function stuttered_page_up_extend(buffer) end @@ -2853,18 +2835,18 @@ function vc_home(buffer) end function vc_home_display(buffer) end --- --- Like `buffer:vc_home_display()`, but extends the selected text to the new +-- Like `buffer.vc_home_display()`, but extends the selected text to the new -- position. -- @param buffer A buffer. function vc_home_display_extend(buffer) end --- --- Like `buffer:vc_home()`, but extends the selected text to the new position. +-- Like `buffer.vc_home()`, but extends the selected text to the new position. -- @param buffer A buffer. function vc_home_extend(buffer) end --- --- Like `buffer:vc_home()`, but extends the rectangular selection to the new +-- Like `buffer.vc_home()`, but extends the rectangular selection to the new -- position. -- @param buffer A buffer. function vc_home_rect_extend(buffer) end @@ -2876,7 +2858,7 @@ function vc_home_rect_extend(buffer) end function vc_home_wrap(buffer) end --- --- Like `buffer:vc_home_wrap()`, but extends the selected text to the new +-- Like `buffer.vc_home_wrap()`, but extends the selected text to the new -- position. -- @param buffer A buffer. function vc_home_wrap_extend(buffer) end @@ -2924,7 +2906,7 @@ function word_left(buffer) end function word_left_end(buffer) end --- --- Like `buffer:word_left_end()`, but extends the selected text to the new +-- Like `buffer.word_left_end()`, but extends the selected text to the new -- position. -- @param buffer A buffer. function word_left_end_extend(buffer) end @@ -2984,7 +2966,7 @@ function word_right(buffer) end function word_right_end(buffer) end --- --- Like `buffer:word_right_end()`, but extends the selected text to the new +-- Like `buffer.word_right_end()`, but extends the selected text to the new -- position. -- @param buffer A buffer. function word_right_end_extend(buffer) end @@ -3077,7 +3059,7 @@ function get_lexer(buffer, current) end -- @param buffer A buffer. -- @param lexer Optional string lexer name to set. If `nil`, attempts to -- auto-detect the buffer's lexer. --- @usage buffer.set_lexer(buffer, 'lexer_name') +-- @usage buffer:set_lexer('lexer_name') function set_lexer(buffer, lexer) end -- Unused Fields. diff --git a/core/.view.luadoc b/core/.view.luadoc index ecdc4061..c38a8485 100644 --- a/core/.view.luadoc +++ b/core/.view.luadoc @@ -8,7 +8,7 @@ module('view') --- --- The [buffer](buffer.html) the view contains. (Read-only) +-- The [buffer](#buffer) the view contains. (Read-only) -- @class table -- @name buffer local buffer @@ -35,14 +35,14 @@ function unsplit(view) end --- -- Switches to buffer number *n* in the view. -- *relative* indicates whether or not *n* is an index relative to the current --- buffer's index in `_G._BUFFERS` instead of an absolute index. +-- buffer's index in `_BUFFERS` instead of an absolute index. -- Emits `BUFFER_BEFORE_SWITCH` and `BUFFER_AFTER_SWITCH` events. -- @param view The view to switch buffers in. --- @param n A relative or absolute buffer index in `_G._BUFFERS`. An absolute --- index of `-1` goes to the last buffer. +-- @param n A relative or absolute buffer index in `_BUFFERS`. An absolute index +-- of `-1` goes to the last buffer. -- @param relative Optional flag indicating whether *n* is a relative or -- absolute index. The default value is `false`, for an absolute index. --- @see _G._G._BUFFERS +-- @see _G._BUFFERS -- @see events.BUFFER_BEFORE_SWITCH -- @see events.BUFFER_AFTER_SWITCH function goto_buffer(view, n, relative) end diff --git a/core/args.lua b/core/args.lua index cc34e837..d33191a4 100644 --- a/core/args.lua +++ b/core/args.lua @@ -43,7 +43,7 @@ end -- Emits an `ARG_NONE` event when no arguments are present. -- @param arg Argument table. -- @see register --- @see events +-- @see _G.events -- @name process function M.process(arg) local no_args = true diff --git a/core/events.lua b/core/events.lua index a79be38b..ebd3388a 100644 --- a/core/events.lua +++ b/core/events.lua @@ -13,7 +13,7 @@ local M = {} -- event has a set of event handlers, which are simply Lua functions called in -- the order they were connected to an event. For example, if you created a -- module that needs to do something each time Textadept creates a new buffer, --- connect a Lua function to the [BUFFER_NEW](#BUFFER_NEW) event: +-- connect a Lua function to the [`events.BUFFER_NEW`]() event: -- -- events.connect(events.BUFFER_NEW, function() -- -- Do something here. @@ -42,23 +42,23 @@ local M = {} -- Emitted after selecting an item from an autocompletion list, but before -- inserting that item into the buffer. -- Automatic insertion can be cancelled by calling --- [`buffer:auto_c_cancel()`][] before returning from the event handler. +-- [`buffer:auto_c_cancel()`]() before returning from the event handler. -- Arguments: -- -- * _`text`_: The selection's text. -- * _`position`_: The autocompleted word's beginning position. -- @field BUFFER_AFTER_SWITCH (string) -- Emitted right after switching to another buffer. --- Emitted by [`view:goto_buffer()`][]. +-- Emitted by [`view.goto_buffer()`](). -- @field BUFFER_BEFORE_SWITCH (string) -- Emitted right before switching to another buffer. --- Emitted by [`view:goto_buffer()`][]. +-- Emitted by [`view.goto_buffer()`](). -- @field BUFFER_DELETED (string) -- Emitted after deleting a buffer. --- Emitted by [`buffer:delete()`][]. +-- Emitted by [`buffer.delete()`](). -- @field BUFFER_NEW (string) -- Emitted after creating a new buffer. --- Emitted on startup and by [`buffer.new()`][]. +-- Emitted on startup and by [`buffer.new()`](). -- @field CALL_TIP_CLICK (string) -- Emitted when clicking on a calltip. -- Arguments: @@ -100,7 +100,7 @@ local M = {} -- * _`x`_: The x-coordinate of the mouse in the view. -- * _`y`_: The y-coordinate of the mouse in the view. -- @field DWELL_START (string) --- Emitted when the mouse is stationary for [`buffer.mouse_dwell_time`][] +-- Emitted when the mouse is stationary for [`buffer.mouse_dwell_time`]() -- milliseconds. -- Arguments: -- @@ -192,12 +192,12 @@ local M = {} -- Emitted after selecting a menu item. -- Arguments: -- --- * _`menu_id`_: The numeric ID of the menu item set in [`ui.menu()`][]. +-- * _`menu_id`_: The numeric ID of the menu item set in [`ui.menu()`](). -- @field QUIT (string) -- Emitted when quitting Textadept. -- When connecting to this event, connect with an index of 1 or the handler -- will be ignored. --- Emitted by [`quit()`][]. +-- Emitted by [`quit()`](). -- @field REPLACE (string) -- Emitted to replace selected (found) text. -- Arguments: @@ -211,10 +211,10 @@ local M = {} -- * _`repl_text`_: The replacement text. -- @field RESET_AFTER (string) -- Emitted after resetting the Lua state. --- Emitted by [`reset()`][]. +-- Emitted by [`reset()`](). -- @field RESET_BEFORE (string) -- Emitted before resetting the Lua state. --- Emitted by [`reset()`][]. +-- Emitted by [`reset()`](). -- @field SAVE_POINT_LEFT (string) -- Emitted after leaving a save point. -- @field SAVE_POINT_REACHED (string) @@ -242,30 +242,18 @@ local M = {} -- Emitted after selecting an item in a user list. -- Arguments: -- --- * _`id`_: The *id* from [`buffer:user_list_show()`][]. +-- * _`id`_: The *id* from [`buffer.user_list_show()`](). -- * _`text`_: The selection's text. -- * _`position`_: The position the list was displayed at. -- @field VIEW_NEW (string) -- Emitted after creating a new view. --- Emitted on startup and by [`view:split()`][]. +-- Emitted on startup and by [`view.split()`](). -- @field VIEW_BEFORE_SWITCH (string) -- Emitted right before switching to another view. --- Emitted by [`ui.goto_view()`][]. +-- Emitted by [`ui.goto_view()`](). -- @field VIEW_AFTER_SWITCH (string) -- Emitted right after switching to another view. --- Emitted by [`ui.goto_view()`][]. --- --- [`buffer:auto_c_cancel()`]: buffer.html#auto_c_cancel --- [`view:goto_buffer()`]: view.html#goto_buffer --- [`buffer.new()`]: buffer.html#new --- [`buffer:delete()`]: buffer.html#delete --- [`buffer.mouse_dwell_time`]: buffer.html#mouse_dwell_time --- [`ui.menu()`]: ui.html#menu --- [`quit()`]: _G.html#quit --- [`reset()`]: _G.html#reset --- [`buffer:user_list_show()`]: buffer.html#user_list_show --- [`view:split()`]: view.html#split --- [`ui.goto_view()`]: ui.html#goto_view +-- Emitted by [`ui.goto_view()`](). module('events')]] local handlers = {} diff --git a/core/file_io.lua b/core/file_io.lua index eb91ed2a..8c861bd5 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -5,25 +5,25 @@ -- Extends Lua's `io` library with Textadept functions for working with files. -- @field _G.events.FILE_OPENED (string) -- Emitted after opening a file in a new buffer. --- Emitted by [`open_file()`](#open_file). +-- Emitted by [`io.open_file()`](). -- Arguments: -- -- * _`filename`_: The opened file's filename. -- @field _G.events.FILE_BEFORE_SAVE (string) -- Emitted right before saving a file to disk. --- Emitted by [`io.save_file()`](#save_file). +-- Emitted by [`io.save_file()`](). -- Arguments: -- -- * _`filename`_: The filename of the file being saved. -- @field _G.events.FILE_AFTER_SAVE (string) -- Emitted right after saving a file to disk. --- Emitted by [`io.save_file()`](#save_file). +-- Emitted by [`io.save_file()`](). -- Arguments: -- -- * _`filename`_: The filename of the file being saved. -- @field _G.events.FILE_SAVED_AS (string) -- Emitted after saving a file under a different filename. --- Emitted by [`io.save_file_as()`](#save_file_as). +-- Emitted by [`io.save_file_as()`](). -- Arguments: -- -- * _`filename`_: The new filename. diff --git a/core/init.lua b/core/init.lua index 23d64b40..b2ca7e0e 100644 --- a/core/init.lua +++ b/core/init.lua @@ -57,7 +57,7 @@ end -- */Users/username/* respectively). -- @field _CHARSET (string) -- The filesystem's character encoding. --- This is used when [working with files](io.html). +-- This is used when [working with files](#io). -- @field WIN32 (bool) -- Whether or not Textadept is running on Windows. -- @field OSX (bool) @@ -66,7 +66,7 @@ end -- Whether or not Textadept is running in the terminal. -- Curses feature incompatibilities are listed in the [Appendix][]. -- --- [Appendix]: ../14_Appendix.html#Curses.Compatibility +-- [Appendix]: manual.html#Curses.Compatibility module('_G')]] --[[ The tables below were defined in C. @@ -74,7 +74,7 @@ module('_G')]] --- -- Table of command line parameters passed to Textadept. -- @class table --- @see _G.args +-- @see args -- @name arg local arg @@ -101,13 +101,13 @@ local _BUFFERS local _VIEWS --- --- The current [buffer](buffer.html) in the current [view](#view). +-- The current [buffer](#buffer) in the [current view](#_G.view). -- @class table -- @name buffer local buffer --- --- The current [view](view.html). +-- The current [view](#view). -- @class table -- @name view local view diff --git a/core/keys.lua b/core/keys.lua index 7d658a57..0761cfa1 100644 --- a/core/keys.lua +++ b/core/keys.lua @@ -47,7 +47,7 @@ local M = {} -- keyboard, since the combination of `Ctrl+Shift+,` has the key sequence `c<` -- (`Shift+,` inserts a `<`), Textadept recognizes the key binding as `Ctrl+<`. -- This allows key bindings to be language and layout agnostic. For key values --- greater than 255, Textadept uses the [`KEYSYMS`](#KEYSYMS) lookup table. +-- greater than 255, Textadept uses the [`keys.KEYSYMS`]() lookup table. -- Therefore, `Ctrl+Right Arrow` has the key sequence `cright`. Uncommenting the -- `print()` statements in *core/keys.lua* causes Textadept to print key -- sequences to standard out (stdout) for inspection. @@ -63,13 +63,11 @@ local M = {} -- keys['a('] = {textadept.editing.enclose, '(', ')'} -- keys['cu'] = function() io.snapopen(_USERHOME) end -- --- Textadept handles [`buffer`][] references properly in static contexts. --- --- [`buffer`]: buffer.html +-- Textadept handles [`buffer`]() references properly in static contexts. -- -- ## Modes -- --- Modes are groups of key bindings such that when a key [mode](#MODE) is +-- Modes are groups of key bindings such that when a key [mode](#keys.MODE) is -- active, Textadept ignores all key bindings defined outside the mode until the -- mode is unset. Here is a simple vi mode example: -- @@ -94,9 +92,10 @@ local M = {} -- -- Key chains are a powerful concept. They allow you to assign multiple key -- bindings to one key sequence. Language modules --- [use key chains](#LANGUAGE_MODULE_PREFIX) for their functions. By default, --- the `Esc` (`⎋` on Mac OSX | `Esc` in curses) key cancels a key chain, but you --- can redefine it via [`CLEAR`](#CLEAR). An example key chain looks like: +-- [use key chains](#keys.LANGUAGE_MODULE_PREFIX) for their functions. By +-- default, the `Esc` (`⎋` on Mac OSX | `Esc` in curses) key cancels a key +-- chain, but you can redefine it via [`keys.CLEAR`](). An example key chain +-- looks like: -- -- keys['aa'] = { -- a = function1, diff --git a/core/lfs_ext.lua b/core/lfs_ext.lua index a1d9c523..b43d8cc5 100644 --- a/core/lfs_ext.lua +++ b/core/lfs_ext.lua @@ -44,7 +44,7 @@ end -- Iterates over all files and sub-directories in directory *dir*, calling -- function *f* with each file found. -- Files passed to *f* do not match any pattern in string or table *filter*, --- and, unless *exclude_FILTER* is `true`, `FILTER` as well. A filter table +-- and, unless *exclude_FILTER* is `true`, `lfs.FILTER` as well. A filter table -- contains Lua patterns that match filenames to exclude, an optional `folders` -- sub-table that contains patterns matching directories to exclude, and an -- optional `extensions` sub-table that contains raw file extensions to exclude. @@ -55,7 +55,7 @@ end -- `false` explicitly, iteration ceases. -- @param filter Optional filter for files and directories to exclude. -- @param exclude_FILTER Optional flag indicating whether or not to exclude the --- default filter `FILTER` in the search. If `false`, adds `FILTER` to +-- default filter `lfs.FILTER` in the search. If `false`, adds `lfs.FILTER` to -- *filter*. -- The default value is `false` to include the default filter. -- @param recursing Utility flag indicating whether or not this function has diff --git a/core/ui.lua b/core/ui.lua index e78e6c29..df495476 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -8,13 +8,13 @@ local ui = ui -- @field title (string, Write-only) -- The title text of Textadept's window. -- @field context_menu (userdata) --- The buffer's context menu, a [`ui.menu()`](#menu). +-- The buffer's context menu, a [`ui.menu()`](). -- This is a low-level field. You probably want to use the higher-level --- `textadept.menu.context_menu`. +-- [`textadept.menu.context_menu`](). -- @field tab_context_menu (userdata) --- The context menu for the buffer's tab, a [`ui.menu()`](#menu). +-- The context menu for the buffer's tab, a [`ui.menu()`](). -- This is a low-level field. You probably want to use the higher-level --- `textadept.menu.tab_context_menu`. +-- [`textadept.menu.tab_context_menu`](). -- @field clipboard_text (string) -- The text on the clipboard. -- @field statusbar_text (string, Write-only) @@ -413,16 +413,15 @@ local size The functions below are Lua C functions. --- --- Low-level function for prompting the user with a [gtdialog][]s of kind *kind* +-- Low-level function for prompting the user with a [gtdialog][] of kind *kind* -- with the given string and table arguments, returning a formatted string of -- the dialog's output. --- You probably want to use the higher-level functions in the [`ui.dialogs`][] +-- You probably want to use the higher-level functions in the [`ui.dialogs`]() -- module. -- Table arguments containing strings are allowed and expanded in place. This is -- useful for filtered list dialogs with many items. -- -- [gtdialog]: http://foicica.com/gtdialog/02_Usage.html --- [`ui.dialogs`]: ui.dialogs.html -- @param kind The kind of gtdialog. -- @param ... Parameters to the gtdialog. -- @return string gtdialog result. @@ -445,12 +444,12 @@ local get_split_table --- -- Shifts to view number *n*. -- *relative* indicates whether or not *n* is an index relative to the current --- view's index in `_G._VIEWS` instead of an absolute index. +-- view's index in `_VIEWS` instead of an absolute index. -- Emits `VIEW_BEFORE_SWITCH` and `VIEW_AFTER_SWITCH` events. --- @param n A relative or absolute view index in `_G._VIEWS`. +-- @param n A relative or absolute view index in `_VIEWS`. -- @param relative Optional flag that indicates whether *n* is a relative or -- absolute index. The default value is `false`, for an absolute index. --- @see _G._G._VIEWS +-- @see _G._VIEWS -- @see events.VIEW_BEFORE_SWITCH -- @see events.VIEW_AFTER_SWITCH -- @class function -- cgit v1.2.3