From ff7f869ae0a02535dcc7f44a65dd3ea2fed87d01 Mon Sep 17 00:00:00 2001
From: mitchell <70453897+orbitalquark@users.noreply.github.com>
Date: Sun, 11 Oct 2020 22:43:59 -0400
Subject: Updated LuaDoc.
---
core/.buffer.luadoc | 7 +++---
core/.iconv.luadoc | 1 +
core/.view.luadoc | 4 ++--
core/args.lua | 60 +++++++++++++++++++++++-----------------------
core/events.lua | 12 +++++-----
docs/api.md | 44 ++++++++++++++++++----------------
docs/changelog.md | 16 ++++++-------
docs/manual.md | 2 +-
modules/lua/ta_api | 18 +++++++-------
modules/textadept/find.lua | 12 ++++++++++
10 files changed, 96 insertions(+), 80 deletions(-)
diff --git a/core/.buffer.luadoc b/core/.buffer.luadoc
index be71940a..8253f22a 100644
--- a/core/.buffer.luadoc
+++ b/core/.buffer.luadoc
@@ -655,8 +655,8 @@ function convert_eols(buffer, mode) end
function copy(buffer) end
---
--- Copies the range of text between positions *start_pos* and *end_pos* to the
--- clipboard.
+-- Copies to the clipboard the range of text between positions *start_pos* and
+-- *end_pos*.
-- @param buffer A buffer.
-- @param start_pos The start position of the range of text in *buffer* to copy.
-- @param end_pos The end position of the range of text in *buffer* to copy.
@@ -1789,6 +1789,7 @@ function reload(buffer) end
---
-- Saves the buffer to its file.
+-- If the buffer does not have a file, the user is prompted for one.
-- Emits `FILE_BEFORE_SAVE` and `FILE_AFTER_SAVE` events.
-- @param buffer A buffer.
-- @name save
@@ -1815,7 +1816,7 @@ function save_as(buffer, filename) end
function close(buffer, force) end
---
--- Converts the current buffer's contents to encoding *encoding*.
+-- Converts the buffer's contents to encoding *encoding*.
-- @param buffer A buffer.
-- @param encoding The string encoding to set. Valid encodings are ones that GNU
-- iconv accepts. If `nil`, assumes a binary encoding.
diff --git a/core/.iconv.luadoc b/core/.iconv.luadoc
index 9ccbe057..adaeaea3 100644
--- a/core/.iconv.luadoc
+++ b/core/.iconv.luadoc
@@ -8,6 +8,7 @@ module('string')
---
-- Converts string *text* from encoding *old* to encoding *new* using GNU
-- libiconv, returning the string result.
+-- Raises an error if the encoding conversion failed.
-- Valid encodings are [GNU libiconv's encodings][] and include:
--
-- * European: ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15,16}, KOI8-R, KOI8-U,
diff --git a/core/.view.luadoc b/core/.view.luadoc
index 2cb742e2..11b0c6ca 100644
--- a/core/.view.luadoc
+++ b/core/.view.luadoc
@@ -88,8 +88,8 @@
-- Color the background of the line that contains the caret a different color.
-- The default value is `false`.
-- @field caret_line_visible_always (bool)
--- Always show the caret line, even when the window is not in focus.
--- The default value is `false`, showing the line only when the window is in
+-- Always show the caret line, even when the view is not in focus.
+-- The default value is `false`, showing the line only when the view is in
-- focus.
-- @field caret_period (number)
-- The time between caret blinks in milliseconds.
diff --git a/core/args.lua b/core/args.lua
index 4a7f7eef..3d249c9a 100644
--- a/core/args.lua
+++ b/core/args.lua
@@ -11,34 +11,34 @@ module('args')]]
events.ARG_NONE = 'arg_none'
--- Contains registered command line switches.
+-- Contains registered command line options.
-- @class table
--- @name switches
-local switches = {}
+-- @name options
+local options = {}
---
--- Registers a command line switch with short and long versions *short* and
--- *long*, respectively. *narg* is the number of arguments the switch accepts,
--- *f* is the function called when the switch is tripped, and *description* is
--- the switch's description when displaying help.
--- @param short The string short version of the switch.
--- @param long The string long version of the switch.
--- @param narg The number of expected parameters for the switch.
--- @param f The Lua function to run when the switch is tripped. It is passed
--- *narg* string arguments.
--- @param description The string description of the switch for command line
+-- Registers a command line option with short and long versions *short* and
+-- *long*, respectively. *narg* is the number of arguments the option accepts,
+-- *f* is the function called when the option is set, and *description* is
+-- the option's description when displaying help.
+-- @param short The string short version of the option.
+-- @param long The string long version of the option.
+-- @param narg The number of expected parameters for the option.
+-- @param f The Lua function to run when the option is set. It is passed *narg*
+-- string arguments.
+-- @param description The string description of the option for command line
-- help.
-- @name register
function M.register(short, long, narg, f, description)
- local switch = {
+ local option = {
narg = assert_type(narg, 'number', 3), f = assert_type(f, 'function', 4),
description = assert_type(description, 'string', 5)
}
- switches[assert_type(short, 'string', 1)] = switch
- switches[assert_type(long, 'string', 2)] = switch
+ options[assert_type(short, 'string', 1)] = option
+ options[assert_type(long, 'string', 2)] = option
end
--- Processes command line argument table *arg*, handling switches previously
+-- Processes command line argument table *arg*, handling options previously
-- defined using `args.register()` and treating unrecognized arguments as
-- filenames to open.
-- Emits an `ARG_NONE` event when no arguments are present unless
@@ -50,10 +50,10 @@ local function process(arg, no_emit_arg_none)
local no_args = true
local i = 1
while i <= #arg do
- local switch = switches[arg[i]]
- if switch then
- switch.f(table.unpack(arg, i + 1, i + switch.narg))
- i = i + switch.narg
+ local option = options[arg[i]]
+ if option then
+ option.f(table.unpack(arg, i + 1, i + option.narg))
+ i = i + option.narg
else
local filename = lfs.abspath(arg[i], arg[-1] or lfs.currentdir())
if lfs.attributes(filename, 'mode') ~= 'directory' then
@@ -72,17 +72,17 @@ events.connect(events.INITIALIZED, function() if arg then process(arg) end end)
events.connect('command_line', function(arg) process(arg, true) end)
if not CURSES then
- -- Shows all registered command line switches on the command line.
+ -- Shows all registered command line options on the command line.
M.register('-h', '--help', 0, function()
print('Usage: textadept [args] [filenames]')
local list = {}
- for name in pairs(switches) do list[#list + 1] = name end
+ for name in pairs(options) do list[#list + 1] = name end
table.sort(
list, function(a, b) return a:match('[^-]+') < b:match('[^-]+') end)
for _, name in ipairs(list) do
- local switch = switches[name]
+ local option = options[name]
print(string.format(
- ' %s [%d args]: %s', name, switch.narg, switch.description))
+ ' %s [%d args]: %s', name, option.narg, option.description))
end
os.exit()
end, 'Shows this')
@@ -92,12 +92,12 @@ if not CURSES then
quit()
end, 'Prints Textadept version and copyright')
-- After Textadept finishes initializing and processes arguments, remove the
- -- help and version switches in order to prevent another instance from sending
+ -- help and version options in order to prevent another instance from sending
-- '-h', '--help', '-v', and '--version' to the first instance, killing the
-- latter.
events.connect(events.INITIALIZED, function()
- switches['-h'], switches['--help'] = nil, nil
- switches['-v'], switches['--version'] = nil, nil
+ options['-h'], options['--help'] = nil, nil
+ options['-v'], options['--version'] = nil, nil
end)
end
@@ -105,8 +105,8 @@ end
-- This needs to be set as soon as possible since the processing of arguments is
-- positional.
_USERHOME = os.getenv(not WIN32 and 'HOME' or 'USERPROFILE') .. '/.textadept'
-for i, switch in ipairs(arg) do
- if (switch == '-u' or switch == '--userhome') and arg[i + 1] then
+for i, option in ipairs(arg) do
+ if (option == '-u' or option == '--userhome') and arg[i + 1] then
_USERHOME = arg[i + 1]
break
end
diff --git a/core/events.lua b/core/events.lua
index 4a1a6334..7282172d 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -95,8 +95,8 @@ local M = {}
--
-- * _`position`_: The position double-clicked.
-- * _`line`_: The line number of the position double-clicked.
--- * _`modifiers`_: A bit-mask of any modifier keys used: `view.MOD_CTRL`,
--- `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.
+-- * _`modifiers`_: A bit-mask of any modifier keys held down:
+-- `view.MOD_CTRL`, `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.
-- On macOS, the Command modifier key is reported as `view.MOD_CTRL` and
-- Ctrl is `view.MOD_META`.
-- Note: If you set `view.rectangular_selection_modifier` to
@@ -150,8 +150,8 @@ local M = {}
-- Arguments:
--
-- * _`position`_: The clicked text's position.
--- * _`modifiers`_: A bit-mask of any modifier keys used: `view.MOD_CTRL`,
--- `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.
+-- * _`modifiers`_: A bit-mask of any modifier keys held down:
+-- `view.MOD_CTRL`, `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.
-- On macOS, the Command modifier key is reported as `view.MOD_CTRL` and
-- Ctrl is `view.MOD_META`.
-- Note: If you set `view.rectangular_selection_modifier` to
@@ -182,8 +182,8 @@ local M = {}
--
-- * _`margin`_: The margin number clicked.
-- * _`position`_: The beginning position of the clicked margin's line.
--- * _`modifiers`_: A bit-mask of any modifier keys used: `view.MOD_CTRL`,
--- `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.
+-- * _`modifiers`_: A bit-mask of any modifier keys held down:
+-- `view.MOD_CTRL`, `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.
-- On macOS, the Command modifier key is reported as `view.MOD_CTRL` and
-- Ctrl is `view.MOD_META`.
-- Note: If you set `view.rectangular_selection_modifier` to
diff --git a/docs/api.md b/docs/api.md
index 941c0b11..b601efad 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -557,19 +557,19 @@ Emitted when no command line arguments are passed to Textadept on startup.
#### `args.register`(*short, long, narg, f, description*)
-Registers a command line switch with short and long versions *short* and
-*long*, respectively. *narg* is the number of arguments the switch accepts,
-*f* is the function called when the switch is tripped, and *description* is
-the switch's description when displaying help.
+Registers a command line option with short and long versions *short* and
+*long*, respectively. *narg* is the number of arguments the option accepts,
+*f* is the function called when the option is set, and *description* is
+the option's description when displaying help.
Parameters:
-* *`short`*: The string short version of the switch.
-* *`long`*: The string long version of the switch.
-* *`narg`*: The number of expected parameters for the switch.
-* *`f`*: The Lua function to run when the switch is tripped. It is passed
- *narg* string arguments.
-* *`description`*: The string description of the switch for command line
+* *`short`*: The string short version of the option.
+* *`long`*: The string long version of the option.
+* *`narg`*: The number of expected parameters for the option.
+* *`f`*: The Lua function to run when the option is set. It is passed *narg*
+ string arguments.
+* *`description`*: The string description of the option for command line
help.
@@ -1860,8 +1860,8 @@ Parameters:
#### `buffer.copy_range`(*buffer, start\_pos, end\_pos*)
-Copies the range of text between positions *start_pos* and *end_pos* to the
-clipboard.
+Copies to the clipboard the range of text between positions *start_pos* and
+*end_pos*.
Parameters:
@@ -3125,6 +3125,7 @@ Parameters:
#### `buffer.save`(*buffer*)
Saves the buffer to its file.
+If the buffer does not have a file, the user is prompted for one.
Emits `FILE_BEFORE_SAVE` and `FILE_AFTER_SAVE` events.
Parameters:
@@ -3266,7 +3267,7 @@ Parameters:
#### `buffer.set_encoding`(*buffer, encoding*)
-Converts the current buffer's contents to encoding *encoding*.
+Converts the buffer's contents to encoding *encoding*.
Parameters:
@@ -3943,8 +3944,8 @@ Emitted after double-clicking the mouse button.
* _`position`_: The position double-clicked.
* _`line`_: The line number of the position double-clicked.
- * _`modifiers`_: A bit-mask of any modifier keys used: `view.MOD_CTRL`,
- `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.
+ * _`modifiers`_: A bit-mask of any modifier keys held down:
+ `view.MOD_CTRL`, `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.
On macOS, the Command modifier key is reported as `view.MOD_CTRL` and
Ctrl is `view.MOD_META`.
Note: If you set `view.rectangular_selection_modifier` to
@@ -4010,8 +4011,8 @@ Emitted when clicking the mouse on text that has an indicator present.
Arguments:
* _`position`_: The clicked text's position.
- * _`modifiers`_: A bit-mask of any modifier keys used: `view.MOD_CTRL`,
- `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.
+ * _`modifiers`_: A bit-mask of any modifier keys held down:
+ `view.MOD_CTRL`, `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.
On macOS, the Command modifier key is reported as `view.MOD_CTRL` and
Ctrl is `view.MOD_META`.
Note: If you set `view.rectangular_selection_modifier` to
@@ -4054,8 +4055,8 @@ Emitted when clicking the mouse inside a sensitive margin.
* _`margin`_: The margin number clicked.
* _`position`_: The beginning position of the clicked margin's line.
- * _`modifiers`_: A bit-mask of any modifier keys used: `view.MOD_CTRL`,
- `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.
+ * _`modifiers`_: A bit-mask of any modifier keys held down:
+ `view.MOD_CTRL`, `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.
On macOS, the Command modifier key is reported as `view.MOD_CTRL` and
Ctrl is `view.MOD_META`.
Note: If you set `view.rectangular_selection_modifier` to
@@ -6416,6 +6417,7 @@ Extends Lua's `string` library to provide character set conversions.
Converts string *text* from encoding *old* to encoding *new* using GNU
libiconv, returning the string result.
+Raises an error if the encoding conversion failed.
Valid encodings are [GNU libiconv's encodings][] and include:
* European: ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15,16}, KOI8-R, KOI8-U,
@@ -10040,8 +10042,8 @@ Color the background of the line that contains the caret a different color.
#### `view.caret_line_visible_always` (bool)
-Always show the caret line, even when the window is not in focus.
- The default value is `false`, showing the line only when the window is in
+Always show the caret line, even when the view is not in focus.
+ The default value is `false`, showing the line only when the view is in
focus.
diff --git a/docs/changelog.md b/docs/changelog.md
index ac3dfb59..4d640b03 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -116,7 +116,7 @@ Bugfixes:
* Fixed toggling of Find & Replace Pane visibility with `ui.find.focus()`.
* Fixed potential hangs with `os.spawn()` in the terminal version.
-* Fixed `--line` command line switch.
+* Fixed `--line` command line option.
* Fixed `ui.dialogs.optionselect()`'s `text` option.
* Call `os.spawn()` exit callback after `proc:wait()`.
* Fixed an instance of buffer selection data not being saved to a session.
@@ -496,7 +496,7 @@ Changes:
* `textadept.editing.highlight_word()` does not select the word by default
anymore.
* Changed [file filter][] format to be more flat and intuitive.
-* Added `-l` and `--line` command line switches to jump to a buffer line.
+* Added `-l` and `--line` command line options to jump to a buffer line.
* Updated to [PDCurses][] 3.6 for the Windows terminal version.
[`textadept.editing.show_documentation()`]: api.html#textadept.editing.show_documentation
@@ -1280,7 +1280,7 @@ Changes:
Bugfixes:
* Ensure `events.BUFFER_AFTER_SWITCH` is fired before `events.BUFFER_DELETED`.
-* Prevent command line help switches from exiting an open instance of Textadept.
+* Prevent command line help options from exiting an open instance of Textadept.
Changes:
@@ -2075,13 +2075,13 @@ Bugfixes:
Changes:
-* Added [command line switches][] for loading sessions on startup.
-* Added [command line switches][] for running Lua code on startup.
+* Added [command line options][] for loading sessions on startup.
+* Added [command line options][] for running Lua code on startup.
* Updated AWK lexer.
* Updated to [Scintilla][] 3.2.5.
* Updated to [LuaJIT][] 2.0.1.
-[command line switches]: manual.html#command-line-parameters
+[command line options]: manual.html#command-line-parameters
[Scintilla]: https://scintilla.org
[LuaJIT]: https://luajit.org
@@ -2219,7 +2219,7 @@ Changes:
Bugfixes:
-* Disabled `--help` switch to ncurses version due to terminal output mangling.
+* Disabled `--help` option to ncurses version due to terminal output mangling.
* ncurses replace entry can now be focused.
* Fixed ncurses memory leaks.
* Fixed multiple selection in Mac OSX.
@@ -3170,7 +3170,7 @@ Changes:
* Added Dot and JSON lexers.
* Search `_USERHOME` in addition to `_HOME` for themes.
-* Added command line switch for not loading/saving session.
+* Added command line option for not loading/saving session.
* Modified key bindings to be more key-layout agnostic.
* Added `reset_before` and `reset_after` events while `textadept.reset()` is
being run.
diff --git a/docs/manual.md b/docs/manual.md
index c06b2d05..4fce4653 100644
--- a/docs/manual.md
+++ b/docs/manual.md
@@ -263,7 +263,7 @@ XFCE, etc. button or menu launcher. Textadept's *src/textadept.desktop* and
Textadept accepts a variety of command line arguments, which are listed in the
table below.
-Switch |Arguments|Description
+Option |Arguments|Description
-------------------|:-------:|-----------
`-e`, `--execute` | 1 |Run the given Lua code
`-f`, `--force` | 0 |Forces unique instance
diff --git a/modules/lua/ta_api b/modules/lua/ta_api
index c7be28b9..3d9a9b7f 100644
--- a/modules/lua/ta_api
+++ b/modules/lua/ta_api
@@ -50,7 +50,7 @@ CURSORNORMAL view.CURSORNORMAL (number, Read-only)\n
CURSORREVERSEARROW view.CURSORREVERSEARROW (number, Read-only)\n
CURSORWAIT view.CURSORWAIT (number, Read-only)\n
DEFAULT lexer.DEFAULT (string)\nThe token name for default tokens.
-DOUBLE_CLICK events.DOUBLE_CLICK (string)\nEmitted after double-clicking the mouse button.\nArguments:\n\n* _`position`_: The position double-clicked.\n* _`line`_: The line number of the position double-clicked.\n* _`modifiers`_: A bit-mask of any modifier keys used: `view.MOD_CTRL`,\n `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.\n On macOS, the Command modifier key is reported as `view.MOD_CTRL` and\n Ctrl is `view.MOD_META`.\n Note: If you set `view.rectangular_selection_modifier` to\n `view.MOD_CTRL`, the "Control" modifier is reported as *both* "Control"\n and "Alt" due to a Scintilla limitation with GTK.
+DOUBLE_CLICK events.DOUBLE_CLICK (string)\nEmitted after double-clicking the mouse button.\nArguments:\n\n* _`position`_: The position double-clicked.\n* _`line`_: The line number of the position double-clicked.\n* _`modifiers`_: A bit-mask of any modifier keys held down:\n `view.MOD_CTRL`, `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.\n On macOS, the Command modifier key is reported as `view.MOD_CTRL` and\n Ctrl is `view.MOD_META`.\n Note: If you set `view.rectangular_selection_modifier` to\n `view.MOD_CTRL`, the "Control" modifier is reported as *both* "Control"\n and "Alt" due to a Scintilla limitation with GTK.
DWELL_END events.DWELL_END (string)\nEmitted after `DWELL_START` when the user moves the mouse, presses a key,\nor scrolls the view.\nArguments:\n\n* _`position`_: The position closest to *x* and *y*.\n* _`x`_: The x-coordinate of the mouse in the view.\n* _`y`_: The y-coordinate of the mouse in the view.
DWELL_START events.DWELL_START (string)\nEmitted when the mouse is stationary for `view.mouse_dwell_time`\nmilliseconds.\nArguments:\n\n* _`position`_: The position closest to *x* and *y*.\n* _`x`_: The x-coordinate of the mouse in the view.\n* _`y`_: The y-coordinate of the mouse in the view.
EDGE_BACKGROUND view.EDGE_BACKGROUND (number, Read-only)\n
@@ -98,7 +98,7 @@ FOLD_BLANK lexer.FOLD_BLANK (number)\nFlag indicating that the line is blank.
FOLD_HEADER lexer.FOLD_HEADER (number)\nFlag indicating the line is fold point.
FUNCTION lexer.FUNCTION (string)\nThe token name for function tokens.
IDENTIFIER lexer.IDENTIFIER (string)\nThe token name for identifier tokens.
-INDICATOR_CLICK events.INDICATOR_CLICK (string)\nEmitted when clicking the mouse on text that has an indicator present.\nArguments:\n\n* _`position`_: The clicked text's position.\n* _`modifiers`_: A bit-mask of any modifier keys used: `view.MOD_CTRL`,\n `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.\n On macOS, the Command modifier key is reported as `view.MOD_CTRL` and\n Ctrl is `view.MOD_META`.\n Note: If you set `view.rectangular_selection_modifier` to\n `view.MOD_CTRL`, the "Control" modifier is reported as *both* "Control"\n and "Alt" due to a Scintilla limitation with GTK.
+INDICATOR_CLICK events.INDICATOR_CLICK (string)\nEmitted when clicking the mouse on text that has an indicator present.\nArguments:\n\n* _`position`_: The clicked text's position.\n* _`modifiers`_: A bit-mask of any modifier keys held down:\n `view.MOD_CTRL`, `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.\n On macOS, the Command modifier key is reported as `view.MOD_CTRL` and\n Ctrl is `view.MOD_META`.\n Note: If you set `view.rectangular_selection_modifier` to\n `view.MOD_CTRL`, the "Control" modifier is reported as *both* "Control"\n and "Alt" due to a Scintilla limitation with GTK.
INDICATOR_MAX buffer.INDICATOR_MAX (number, Read-only)\n
INDICATOR_RELEASE events.INDICATOR_RELEASE (string)\nEmitted when releasing the mouse after clicking on text that has an\nindicator present.\nArguments:\n\n* _`position`_: The clicked text's position.
INDIC_BOX view.INDIC_BOX (number, Read-only)\n
@@ -141,7 +141,7 @@ LINUX _G.LINUX (bool)\nWhether or not Textadept is running on Linux.
MARGINOPTION_NONE view.MARGINOPTION_NONE (number, Read-only)\n
MARGINOPTION_SUBLINESELECT view.MARGINOPTION_SUBLINESELECT (number, Read-only)\n
MARGIN_BACK view.MARGIN_BACK (number, Read-only)\n
-MARGIN_CLICK events.MARGIN_CLICK (string)\nEmitted when clicking the mouse inside a sensitive margin.\nArguments:\n\n* _`margin`_: The margin number clicked.\n* _`position`_: The beginning position of the clicked margin's line.\n* _`modifiers`_: A bit-mask of any modifier keys used: `view.MOD_CTRL`,\n `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.\n On macOS, the Command modifier key is reported as `view.MOD_CTRL` and\n Ctrl is `view.MOD_META`.\n Note: If you set `view.rectangular_selection_modifier` to\n `view.MOD_CTRL`, the "Control" modifier is reported as *both* "Control"\n and "Alt" due to a Scintilla limitation with GTK.
+MARGIN_CLICK events.MARGIN_CLICK (string)\nEmitted when clicking the mouse inside a sensitive margin.\nArguments:\n\n* _`margin`_: The margin number clicked.\n* _`position`_: The beginning position of the clicked margin's line.\n* _`modifiers`_: A bit-mask of any modifier keys held down:\n `view.MOD_CTRL`, `view.MOD_SHIFT`, `view.MOD_ALT`, and `view.MOD_META`.\n On macOS, the Command modifier key is reported as `view.MOD_CTRL` and\n Ctrl is `view.MOD_META`.\n Note: If you set `view.rectangular_selection_modifier` to\n `view.MOD_CTRL`, the "Control" modifier is reported as *both* "Control"\n and "Alt" due to a Scintilla limitation with GTK.
MARGIN_COLOR view.MARGIN_COLOR (number, Read-only)\n
MARGIN_FORE view.MARGIN_FORE (number, Read-only)\n
MARGIN_NUMBER view.MARGIN_NUMBER (number, Read-only)\n
@@ -405,7 +405,7 @@ caret_line_back view.caret_line_back (number)\nThe background color, in "0xBBGGR
caret_line_back_alpha view.caret_line_back_alpha (number)\nThe caret line's background alpha value, ranging from `0` (transparent) to\n`255` (opaque).\nThe default value is `view.ALPHA_NOALPHA`, for no alpha.
caret_line_frame view.caret_line_frame (number)\nThe caret line's frame width in pixels.\nWhen non-zero, the line that contains the caret is framed instead of\ncolored in. The `view.caret_line_back` and `view.caret_line_back_alpha`\nproperties apply to the frame.\nThe default value is `0`.
caret_line_visible view.caret_line_visible (bool)\nColor the background of the line that contains the caret a different color.\nThe default value is `false`.
-caret_line_visible_always view.caret_line_visible_always (bool)\nAlways show the caret line, even when the window is not in focus.\nThe default value is `false`, showing the line only when the window is in\nfocus.
+caret_line_visible_always view.caret_line_visible_always (bool)\nAlways show the caret line, even when the view is not in focus.\nThe default value is `false`, showing the line only when the view is in\nfocus.
caret_period view.caret_period (number)\nThe time between caret blinks in milliseconds.\nA value of `0` stops blinking.\nThe default value is `500`.
caret_sticky buffer.caret_sticky (number)\nThe caret's preferred horizontal position when moving between lines.\n\n* `buffer.CARETSTICKY_OFF`\n Use the same position the caret had on the previous line.\n* `buffer.CARETSTICKY_ON`\n Use the last position the caret was moved to via the mouse, left/right\n arrow keys, home/end keys, etc. Typing text does not affect the position.\n* `buffer.CARETSTICKY_WHITESPACE`\n Use the position the caret had on the previous line, but prior to any\n inserted indentation.\n\nThe default value is `buffer.CARETSTICKY_OFF`.
caret_style view.caret_style (number)\nThe caret's visual style.\n\n* `view.CARETSTYLE_INVISIBLE`\n No caret.\n* `view.CARETSTYLE_LINE`\n A line caret.\n* `view.CARETSTYLE_BLOCK`\n A block caret.\n\nAny block setting may be combined with `view.CARETSTYLE_BLOCK_AFTER` via\nbitwise OR (`|`) in order to draw the caret after the end of a selection,\nas opposed to just inside it.\n\nThe default value is `view.CARETSTYLE_LINE`.
@@ -446,7 +446,7 @@ contracted_fold_next view.contracted_fold_next(view, line)\nReturns the line num
convert_eols buffer.convert_eols(buffer, mode)\nConverts all end of line characters to those in end of line mode *mode*.\n@param buffer A buffer.\n@param mode The end of line mode to convert to. Valid values are:\n * `buffer.EOL_CRLF`\n * `buffer.EOL_CR`\n * `buffer.EOL_LF`
convert_indentation textadept.editing.convert_indentation()\nConverts indentation between tabs and spaces according to `buffer.use_tabs`.\nIf `buffer.use_tabs` is `true`, `buffer.tab_width` indenting spaces are\nconverted to tabs. Otherwise, all indenting tabs are converted to\n`buffer.tab_width` spaces.\n@see buffer.use_tabs
copy buffer.copy(buffer)\nCopies the selected text to the clipboard.\nMultiple selections are copied in order with no delimiters. Rectangular\nselections are copied from top to bottom with end of line characters. Virtual\nspace is not copied.\n@param buffer A buffer.
-copy_range buffer.copy_range(buffer, start_pos, end_pos)\nCopies the range of text between positions *start_pos* and *end_pos* to the\nclipboard.\n@param buffer A buffer.\n@param start_pos The start position of the range of text in *buffer* to copy.\n@param end_pos The end position of the range of text in *buffer* to copy.
+copy_range buffer.copy_range(buffer, start_pos, end_pos)\nCopies to the clipboard the range of text between positions *start_pos* and\n*end_pos*.\n@param buffer A buffer.\n@param start_pos The start position of the range of text in *buffer* to copy.\n@param end_pos The end position of the range of text in *buffer* to copy.
copy_text buffer.copy_text(buffer, text)\nCopies string *text* to the clipboard.\n@param buffer A buffer.\n@param text The text to copy.
count_characters buffer.count_characters(buffer, start_pos, end_pos)\nReturns the number of whole characters (taking multi-byte characters into\naccount) between positions *start_pos* and *end_pos*.\n@param buffer A buffer.\n@param start_pos The start position of the range of text in *buffer* to start\n counting at.\n@param end_pos The end position of the range of text in *buffer* to stop\n counting at.\n@return number
current_pos buffer.current_pos (number)\nThe caret's position.\nWhen set, does not scroll the caret into view.
@@ -578,7 +578,7 @@ home_extend buffer.home_extend(buffer)\nMoves the caret to the beginning of the
home_rect_extend buffer.home_rect_extend(buffer)\nMoves the caret to the beginning of the current line, extending the\nrectangular selection to the new position.\n@param buffer A buffer.
home_wrap buffer.home_wrap(buffer)\nMoves the caret to the beginning of the current wrapped line or, if already\nthere, to the beginning of the actual line.\n@param buffer A buffer.
home_wrap_extend buffer.home_wrap_extend(buffer)\nLike `buffer.home_wrap()`, but extends the selected text to the new position.\n@param buffer A buffer.
-iconv string.iconv(text, new, old)\nConverts string *text* from encoding *old* to encoding *new* using GNU\nlibiconv, returning the string result.\nValid encodings are GNU libiconv's encodings and include:\n\n * European: ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15,16}, KOI8-R, KOI8-U,\n KOI8-RU, CP{1250,1251,1252,1253,1254,1257}, CP{850,866,1131},\n Mac{Roman,CentralEurope,Iceland,Croatian,Romania},\n Mac{Cyrillic,Ukraine,Greek,Turkish}, Macintosh.\n * Semitic: ISO-8859-{6,8}, CP{1255,1256}, CP862, Mac{Hebrew,Arabic}.\n * Japanese: EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP, ISO-2022-JP-2,\n ISO-2022-JP-1.\n * Chinese: EUC-CN, HZ, GBK, CP936, GB18030, EUC-TW, BIG5, CP950,\n BIG5-HKSCS, BIG5-HKSCS:2004, BIG5-HKSCS:2001, BIG5-HKSCS:1999,\n ISO-2022-CN, ISO-2022-CN-EXT.\n * Korean: EUC-KR, CP949, ISO-2022-KR, JOHAB.\n * Armenian: ARMSCII-8.\n * Georgian: Georgian-Academy, Georgian-PS.\n * Tajik: KOI8-T.\n * Kazakh: PT154, RK1048.\n * Thai: ISO-8859-11, TIS-620, CP874, MacThai.\n * Laotian: MuleLao-1, CP1133.\n * Vietnamese: VISCII, TCVN, CP1258.\n * Unicode: UTF-8, UCS-2, UCS-2BE, UCS-2LE, UCS-4, UCS-4BE, UCS-4LE, UTF-16,\n UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, UTF-32LE, UTF-7, C99, JAVA.\n@param text The text to convert.\n@param new The string encoding to convert to.\n@param old The string encoding to convert from.
+iconv string.iconv(text, new, old)\nConverts string *text* from encoding *old* to encoding *new* using GNU\nlibiconv, returning the string result.\nRaises an error if the encoding conversion failed.\nValid encodings are GNU libiconv's encodings and include:\n\n * European: ASCII, ISO-8859-{1,2,3,4,5,7,9,10,13,14,15,16}, KOI8-R, KOI8-U,\n KOI8-RU, CP{1250,1251,1252,1253,1254,1257}, CP{850,866,1131},\n Mac{Roman,CentralEurope,Iceland,Croatian,Romania},\n Mac{Cyrillic,Ukraine,Greek,Turkish}, Macintosh.\n * Semitic: ISO-8859-{6,8}, CP{1255,1256}, CP862, Mac{Hebrew,Arabic}.\n * Japanese: EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP, ISO-2022-JP-2,\n ISO-2022-JP-1.\n * Chinese: EUC-CN, HZ, GBK, CP936, GB18030, EUC-TW, BIG5, CP950,\n BIG5-HKSCS, BIG5-HKSCS:2004, BIG5-HKSCS:2001, BIG5-HKSCS:1999,\n ISO-2022-CN, ISO-2022-CN-EXT.\n * Korean: EUC-KR, CP949, ISO-2022-KR, JOHAB.\n * Armenian: ARMSCII-8.\n * Georgian: Georgian-Academy, Georgian-PS.\n * Tajik: KOI8-T.\n * Kazakh: PT154, RK1048.\n * Thai: ISO-8859-11, TIS-620, CP874, MacThai.\n * Laotian: MuleLao-1, CP1133.\n * Vietnamese: VISCII, TCVN, CP1258.\n * Unicode: UTF-8, UCS-2, UCS-2BE, UCS-2LE, UCS-4, UCS-4BE, UCS-4LE, UTF-16,\n UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, UTF-32LE, UTF-7, C99, JAVA.\n@param text The text to convert.\n@param new The string encoding to convert to.\n@param old The string encoding to convert from.
idle_styling view.idle_styling (number)\nThe idle styling mode.\nThis mode has no effect when `view.wrap_mode` is on.\n\n* `view.IDLESTYLING_NONE`\n Style all the currently visible text before displaying it.\n* `view.IDLESTYLING_TOVISIBLE`\n Style some text before displaying it and then style the rest\n incrementally in the background as an idle-time task.\n* `view.IDLESTYLING_AFTERVISIBLE`\n Style text after the currently visible portion in the background.\n* `view.IDLESTYLING_ALL`\n Style text both before and after the visible text in the background.\n\nThe default value is `view.IDLESTYLING_NONE`.
in_files ui.find.in_files (bool)\nFind search text in a directory of files.\nThe default value is `false`.
in_files_label_text ui.find.in_files_label_text (string, Write-only)\nThe text of the "In files" label.\nThis is primarily used for localization.
@@ -787,7 +787,7 @@ rectangular_selection_modifier view.rectangular_selection_modifier (number)\nThe
redo buffer.redo(buffer)\nRedoes the next undone action.\n@param buffer A buffer.
regex ui.find.regex (bool)\nInterpret search text as a Regular Expression.\nThe default value is `false`.
regex_label_text ui.find.regex_label_text (string, Write-only)\nThe text of the "Regex" label.\nThis is primarily used for localization.
-register args.register(short, long, narg, f, description)\nRegisters a command line switch with short and long versions *short* and\n*long*, respectively. *narg* is the number of arguments the switch accepts,\n*f* is the function called when the switch is tripped, and *description* is\nthe switch's description when displaying help.\n@param short The string short version of the switch.\n@param long The string long version of the switch.\n@param narg The number of expected parameters for the switch.\n@param f The Lua function to run when the switch is tripped. It is passed\n *narg* string arguments.\n@param description The string description of the switch for command line\n help.
+register args.register(short, long, narg, f, description)\nRegisters a command line option with short and long versions *short* and\n*long*, respectively. *narg* is the number of arguments the option accepts,\n*f* is the function called when the option is set, and *description* is\nthe option's description when displaying help.\n@param short The string short version of the option.\n@param long The string long version of the option.\n@param narg The number of expected parameters for the option.\n@param f The Lua function to run when the option is set. It is passed *narg*\n string arguments.\n@param description The string description of the option for command line\n help.
register_image view.register_image(view, type, xpm_data)\nRegisters XPM image *xpm_data* to type number *type* for use in\nautocompletion and user lists.\n@param view A view.\n@param type Integer type to register the image with.\n@param xpm_data The XPM data as described in `view.marker_define_pixmap()`.
register_rgba_image view.register_rgba_image(view, type, pixels)\nRegisters RGBA image *pixels* to type number *type* for use in autocompletion\nand user lists.\nThe dimensions for *pixels* (`view.rgba_image_width` and\n`view.rgba_image_height`) must have already been defined. *pixels* is a\nsequence of 4 byte pixel values (red, blue, green, and alpha) defining the\nimage line by line starting at the top-left pixel.\n@param view A view.\n@param type Integer type to register the image with.\n@param pixels The RGBA data as described in\n `view.marker_define_rgba_image()`.
reload buffer.reload(buffer)\nReloads the buffer's file contents, discarding any changes.\nEmits `FILE_BEFORE_RELOAD` and `FILE_AFTER_RELOAD` events if the buffer is\nthe current one.\n@param buffer A buffer.
@@ -811,7 +811,7 @@ run textadept.run.run(filename)\nRuns file *filename* or the current file using
run ui.command_entry.run(f, keys, lang, height)\nOpens the command entry, subjecting it to any key bindings defined in table\n*keys*, highlighting text with lexer name *lang*, and displaying\n*height* number of lines at a time, and then when the `Enter` key is pressed,\ncloses the command entry and calls function *f* (if non-`nil`) with the\ncommand entry's text as an argument.\nBy default with no arguments given, opens a Lua command entry.\nThe command entry does not respond to Textadept's default key bindings, but\ninstead to the key bindings defined in *keys* and in\n`ui.command_entry.editing_keys`.\n@param f Optional function to call upon pressing `Enter` in the command\n entry, ending the mode. It should accept the command entry text as an\n argument.\n@param keys Optional table of key bindings to respond to. This is in\n addition to the basic editing and movement keys defined in\n `ui.command_entry.editing_keys`.\n `Esc` and `Enter` are automatically defined to cancel and finish the\n command entry, respectively.\n This parameter may be omitted completely.\n@param lang Optional string lexer name to use for command entry text. The\n default value is `'text'`.\n@param height Optional number of lines to display in the command entry. The\n default value is `1`.\n@usage ui.command_entry.run(ui.print)\n@see editing_keys
run_commands textadept.run.run_commands (table)\nMap of filenames, file extensions, and lexer names to their associated "run"\nshell command line strings or functions that return strings.\nCommand line strings may have the following macros:\n\n + `%f`: The file's name, including its extension.\n + `%e`: The file's name, excluding its extension.\n + `%d`: The file's directory path.\n + `%p`: The file's full path.\n\nFunctions may also return a working directory to operate in. By default, it\nis the current file's parent directory.
run_in_background textadept.run.run_in_background (bool)\nRun shell commands silently in the background.\nThis only applies when the message buffer is open, though it does not have\nto be visible.\nThe default value is `false`.
-save buffer.save(buffer)\nSaves the buffer to its file.\nEmits `FILE_BEFORE_SAVE` and `FILE_AFTER_SAVE` events.\n@param buffer A buffer.
+save buffer.save(buffer)\nSaves the buffer to its file.\nIf the buffer does not have a file, the user is prompted for one.\nEmits `FILE_BEFORE_SAVE` and `FILE_AFTER_SAVE` events.\n@param buffer A buffer.
save textadept.macros.save(filename)\nSaves a recorded macro to file *filename* or the user-selected file.\n@param filename Optional filename to save the recorded macro to. If `nil`,\n the user is prompted for one.
save textadept.session.save(filename)\nSaves the session to file *filename* or the user-selected file.\nSaves split views, opened buffers, cursor information, recent files, and\nbookmarks.\nUpon quitting, the current session is saved to *filename* again, unless\n`textadept.session.save_on_quit` is `false`.\n@param filename Optional absolute path to the session file to save. If `nil`,\n the user is prompted for one.\n@usage textadept.session.save(filename)
save_all_files io.save_all_files()\nSaves all unsaved buffers to their respective files.\n@see buffer.save
@@ -859,7 +859,7 @@ session textadept.session (module)\nSession support for Textadept.
set_chars_default buffer.set_chars_default(buffer)\nResets `buffer.word_chars`, `buffer.whitespace_chars`, and\n`buffer.punctuation_chars` to their respective defaults.\n@param buffer A buffer.\n@see word_chars\n@see whitespace_chars\n@see punctuation_chars
set_default_fold_display_text view.set_default_fold_display_text(view, text)\nSets the default fold display text to string *text*.\n@param view A view.\n@param text The text to display by default next to folded lines.\n@see toggle_fold_show_text
set_empty_selection buffer.set_empty_selection(buffer, pos)\nMoves the caret to position *pos* without scrolling the view and removes any\nselections.\n@param buffer A buffer\n@param pos The position in *buffer* to move to.
-set_encoding buffer.set_encoding(buffer, encoding)\nConverts the current buffer's contents to encoding *encoding*.\n@param buffer A buffer.\n@param encoding The string encoding to set. Valid encodings are ones that GNU\n iconv accepts. If `nil`, assumes a binary encoding.\n@usage buffer:set_encoding('CP1252')
+set_encoding buffer.set_encoding(buffer, encoding)\nConverts the buffer's contents to encoding *encoding*.\n@param buffer A buffer.\n@param encoding The string encoding to set. Valid encodings are ones that GNU\n iconv accepts. If `nil`, assumes a binary encoding.\n@usage buffer:set_encoding('CP1252')
set_fold_margin_color view.set_fold_margin_color(view, use_setting, color)\nOverrides the fold margin's default color with color *color*, in "0xBBGGRR"\nformat,\nif *use_setting* is `true`.\n@param view A view.\n@param use_setting Whether or not to use *color*.\n@param color The color in "0xBBGGRR" format.
set_fold_margin_hi_color view.set_fold_margin_hi_color(view, use_setting, color)\nOverrides the fold margin's default highlight color with color *color*, in\n"0xBBGGRR" format, if *use_setting* is `true`.\n@param view A view.\n@param use_setting Whether or not to use *color*.\n@param color The color in "0xBBGGRR" format.
set_lexer buffer.set_lexer(buffer, name)\nAssociates string lexer name *name* or the auto-detected lexer name with the\nbuffer and then loads the appropriate language module if that module exists.\n@param buffer A buffer.\n@param name Optional string lexer name to set. If `nil`, attempts to\n auto-detect the buffer's lexer.\n@usage buffer:set_lexer('lexer_name')
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua
index b8d37eed..6dfebb99 100644
--- a/modules/textadept/find.lua
+++ b/modules/textadept/find.lua
@@ -381,6 +381,18 @@ local function unescape(text)
end) or text
end
+--local function replace_target_re(buffer, rtext)
+-- local patt = lpeg.P{
+-- (lpeg.V('tag') + lpeg.V('upper') + lpeg.V('lower') + lpeg.V('stop') + 1)^1,
+-- tag = '\\' * lpeg.C(lpeg.R('09')) / buffer.tag,
+-- upper = '\\U' * lpeg.V('range') / string.upper,
+-- lower = '\\L' * lpeg.V('range') / string.lower,
+-- range = lpeg.C((1 - lpeg.P('\\') * lpeg.S('ULE0123456789'))^0),
+-- stop = lpeg.P('\\E') / ''
+-- }
+-- buffer:replace_target(lpeg.match(lpeg.Cs(patt), rtext))
+--end
+
-- Replaces found (selected) text.
events.connect(events.REPLACE, function(rtext)
if buffer.selection_empty then return end
--
cgit v1.2.3