aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2012-06-28 10:26:22 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2012-06-28 10:26:22 -0400
commit32b58dea354f7d0b90b7d5a43103cc2743ca6dfc (patch)
tree41e84bba833502832b085dabdc74f96465376973
parent1c12f8f078797998476046d5363b82d85fc42f65 (diff)
downloadtextadept-32b58dea354f7d0b90b7d5a43103cc2743ca6dfc.tar.gz
textadept-32b58dea354f7d0b90b7d5a43103cc2743ca6dfc.zip
Updated Lua Adeptsense.
-rw-r--r--modules/lua/api14
-rw-r--r--modules/lua/tags4
2 files changed, 11 insertions, 7 deletions
diff --git a/modules/lua/api b/modules/lua/api
index 5fb80a4d..2d57b7fc 100644
--- a/modules/lua/api
+++ b/modules/lua/api
@@ -100,6 +100,7 @@ MARK_HIGHLIGHT_BACK _M.textadept.editing.MARK_HIGHLIGHT_BACK (number)\nThe backg
MAX _M.textadept.snapopen.MAX (number)\nMaximum number of files to list. The default value is `1000`.
MAX_RECENT_FILES _M.textadept.session.MAX_RECENT_FILES (number)\nThe maximum number of files from the recent files list to save to the\nsession.\nThe default value is `10`.
MENU_CLICKED events.MENU_CLICKED\nCalled when a menu item is selected.\nArguments:\n * `menu_id`: The numeric ID of the menu item set in `gui.gtkmenu()`.
+NCURSES _G.NCURSES (bool)\nIf Textadept is running in the terminal, this flag is `true`.
NUMBER lexer.NUMBER\nToken type for number tokens.
OPERATOR lexer.OPERATOR\nToken type for operator tokens.
OSX _G.OSX (bool)\nIf Textadept is running on Mac OSX, this flag is `true`.
@@ -891,7 +892,7 @@ config package.config (string)\nA string describing some compile-time configurat
connect events.connect(event, f, index)\nAdds a handler function to an event.\n@param event The string event name. It is arbitrary and need not be defined\n anywhere.\n@param f The Lua function to add.\n@param index Optional index to insert the handler into.\n@return Index of handler.\n@see disconnect
constants _SCINTILLA.constants (table)\nScintilla constants.
context_menu _M.textadept.menu.context_menu (table)\nContains the default right-click context menu.
-context_menu gui.context_menu\nA GTK menu defining the editor's context menu.
+context_menu gui.context_menu\nA `gui.menu` defining the editor's context menu.
contracted_fold_next buffer.contracted_fold_next(buffer, line_start)\nFind the next line at or after line_start that is a contracted fold header\nline.\nReturn `-1` when no more lines.\n@param buffer The global buffer.\n@param line_start The start line number.\n@return number
control_char_symbol buffer.control_char_symbol (number)\nThe way control characters are displayed.\nIf less than `32`, keep the rounded rectangle as ASCII mnemonics.\nOtherwise, use the given character byte. The default value is `0`.
control_structure_patterns _M.lua.control_structure_patterns (table)\nPatterns for auto 'end' completion for control structures.\n@see try_to_autocomplete_end
@@ -934,7 +935,7 @@ delete_back buffer.delete_back(buffer)\nDelete the selection or if no selection,
delete_back_not_line buffer.delete_back_not_line(buffer)\nDelete the selection or if no selection, the character before the caret.\nWill not delete the character before at the start of a line.
delete_range buffer.delete_range(buffer, pos, length)\nDelete a range of text in the document.\n@param pos The start position of the range to delete.\n@param length The length of the range to delete.
delimited_range lexer.delimited_range(chars, escape, end_optional, balanced, forbidden)\nCreates an LPeg pattern that matches a range of characters delimitted by a\nspecific character(s).\nThis can be used to match a string, parenthesis, etc.\n@param chars The character(s) that bound the matched range.\n@param escape Optional escape character. This parameter may be omitted, nil,\n or the empty string.\n@param end_optional Optional flag indicating whether or not an ending\n delimiter is optional or not. If true, the range begun by the start\n delimiter matches until an end delimiter or the end of the input is\n reached.\n@param balanced Optional flag indicating whether or not a balanced range is\n matched, like `%b` in Lua's `string.find`. This flag only applies if\n `chars` consists of two different characters (e.g. '()').\n@param forbidden Optional string of characters forbidden in a delimited\n range. Each character is part of the set.\n@usage local sq_str_noescapes = delimited_range("'")\n@usage local sq_str_escapes = delimited_range("'", '\\', true)\n@usage local unbalanced_parens = delimited_range('()', '\\', true)\n@usage local balanced_parens = delimited_range('()', '\\', true, true)
-dialog gui.dialog(kind, ...)\nDisplays a gcocoadialog of a specified type with the given string arguments.\nEach argument is like a string in Lua's `arg` table. Tables of strings are\nallowed as arguments and are expanded in place. This is useful for\nfilteredlist dialogs with many items.\n@param kind The kind of gcocoadialog.\n@param ... Parameters to the gcocoadialog.\n@return string gcocoadialog result.
+dialog gui.dialog(kind, ...)\nDisplays a gtdialog of a specified type with the given string arguments.\nEach argument is like a string in Lua's `arg` table. Tables of strings are\nallowed as arguments and are expanded in place. This is useful for\nfilteredlist dialogs with many items.\n@param kind The kind of gtdialog.\n@param ... Parameters to the gtdialog.\n@return string gtdialog result.
difftime os.difftime(t2, t1)\nReturns the number of seconds from time `t1` to time `t2`. In POSIX,\nWindows, and some other systems, this value is exactly `t2`*-*`t1`.
digit lexer.digit\nMatches any digit (`0-9`).
dir lfs.dir(path)\nLua iterator over the entries of a given directory. Each time the iterator is\ncalled with dir_obj it returns a directory entry's name as a string, or nil\nif there are no more entries. You can also iterate by calling dir_obj:next(),\nand explicitly close the directory before the iteration finished with\ndir_obj:close(). Raises an error if path is not a directory.
@@ -1070,7 +1071,6 @@ grab_focus buffer.grab_focus(buffer)\nSet the focus to this view.\n@param buffer
graph lexer.graph\nMatches any graphical character (`!` to `~`).
grow_selection _M.textadept.editing.grow_selection(amount)\nGrows the selection by a character amount on either end.\n@param amount The amount to grow the selection on either end.
gsub string.gsub(s, pattern, repl [, n])\nReturns a copy of `s` in which all (or the first `n`, if given)\noccurrences of the `pattern` have been replaced by a replacement string\nspecified by `repl`, which can be a string, a table, or a function. `gsub`\nalso returns, as its second value, the total number of matches that occurred.\nThe name `gsub` comes from "Global SUBstitution".\n\nIf `repl` is a string, then its value is used for replacement. The character\n`%` works as an escape character: any sequence in `repl` of the form `%d`,\nwith `d` between 1 and 9, stands for the value of the `d`-th captured\nsubstring (see below). The sequence `%0` stands for the whole match. The\nsequence `%%` stands for a single `%`.\n\nIf `repl` is a table, then the table is queried for every match, using\nthe first capture as the key; if the pattern specifies no captures, then\nthe whole match is used as the key.\nIf `repl` is a function, then this function is called every time a match\noccurs, with all captured substrings passed as arguments, in order; if\nthe pattern specifies no captures, then the whole match is passed as a\nsole argument.\n\nIf the value returned by the table query or by the function call is a\nstring or a number, then it is used as the replacement string; otherwise,\nif it is false or nil, then there is no replacement (that is, the original\nmatch is kept in the string).\n\nHere are some examples:\n\n x = string.gsub("hello world", "(%w+)", "%1 %1")\n --> x="hello hello world world"\n x = string.gsub("hello world", "%w+", "%0 %0", 1)\n --> x="hello hello world"\n x = string.gsub("hello world from Lua", "(%w+)%s*(%w+)", "%2 %1")\n --> x="world hello Lua from"\n x = string.gsub("home = $HOME, user = $USER", "%$(%w+)", os.getenv)\n --> x="home = /home/roberto, user = roberto"\n x = string.gsub("4+5 = $return 4+5$", "%$(.-)%$", function (s)\n return load(s)()\n end)\n --> x="4+5 = 9"\n local t = {name="lua", version="5.2"}\n x = string.gsub("$name-$version.tar.gz", "%$(%w+)", t)\n --> x="lua-5.2.tar.gz"
-gtkmenu gui.gtkmenu(menu_table)\nCreates a GTK menu, returning the userdata.\n@param menu_table A table defining the menu. It is an ordered list of tables\n with a string menu item, integer menu ID, and optional keycode and modifier\n mask. The latter two are used to display key shortcuts in the menu. The\n string menu item is handled as follows:\n `'gtk-*'` - a stock menu item is created based on the GTK stock-id.\n `'separator'` - a menu separator item is created.\n Otherwise a regular menu item with a mnemonic is created.\n Submenus are just nested menu-structure tables. Their title text is defined\n with a `title` key.\n@see keys.get_gdk_key
gui _G.gui (module)\nThe core gui table.
h_scroll_bar buffer.h_scroll_bar (bool)\nWhether the horizontal scroll bar is visible.\nSet to `false` to never see it and `true` to enable it again. The default\nstate is to display it when needed.
handle_clear _M.textadept.adeptsense.handle_clear(sense)\nCalled when clearing an Adeptsense.\nThis function should be replaced with your own if you have any persistant\nobjects that need to be deleted.\n@param sense The Adeptsense returned by `adeptsense.new()`.
@@ -1235,6 +1235,7 @@ math _G.math (module)\nLua math module.
max math.max(x, ยทยทยท)\nReturns the maximum value among its arguments.
max_line_state buffer.max_line_state (number, Read-only)\nThe last line number that has line state.
menu _M.textadept.menu (module)\nProvides dynamic menus for Textadept.\nThis module should be `require`d last, after `_M.textadept.keys` since it\nlooks up defined key commands to show them in menus.
+menu gui.menu(menu_table)\nCreates a menu, returning the userdata.\n@param menu_table A table defining the menu. It is an ordered list of tables\n with a string menu item, integer menu ID, and optional GDK keycode and\n modifier mask. The latter two are used to display key shortcuts in the\n menu. `_` characters are treated as a menu mnemonics. If the menu item is\n empty, a menu separator item is created. Submenus are just nested\n menu-structure tables. Their title text is defined with a `title` key.\n@usage gui.menu{ { '_New', 1 }, { '_Open', 2 }, { '' }, { '_Quit', 4 } }\n@usage gui.menu{ { '_New', 1, keys.get_gdk_key('cn') } }\n@see keys.get_gdk_key
menubar _M.textadept.menu.menubar (table)\nContains the main menubar.
menubar gui.menubar (table)\nA table of GTK menus defining a menubar. (Write-only)
mime_types _M.textadept.mime_types (module)\nHandles file-specific settings.
@@ -1447,7 +1448,7 @@ set_hotspot_active_fore buffer.set_hotspot_active_fore(buffer, use_setting, colo
set_length_for_encode buffer.set_length_for_encode(buffer, bytes)\nSet the length of the utf8 argument for calling `buffer:encoded_from_utf8()`.\n@param buffer The global buffer.\n@param bytes Bytes or `-1` for measuring to first NUL.
set_lexer buffer.set_lexer(buffer, lang)\nReplacement for `buffer.set_lexer_language(buffer)`.\nSets a `buffer._lexer` field so it can be restored without querying the\nmime-types tables. Also if the user manually sets the lexer, it should be\nrestored.\nLoads the language-specific module if it exists.\nThis function is added by `_M.textadept.mime_types`.\n@param buffer The global buffer.\n@param lang The string language to set.\n@usage buffer.set_lexer(buffer, 'language_name')
set_lexer_language buffer.set_lexer_language(buffer, language_name)\nSet the lexing language of the document based on string name.\n@param buffer The global buffer.\n@param language_name The language name.
-set_menubar _M.textadept.menu.set_menubar(menubar)\nSets `gui.menubar` from the given table of menus.\n@param menubar The table of menus to create the menubar from. Each table\n entry is another table that corresponds to a particular menu. A menu can\n have a `title` key with string value. Each menu item is either a submenu\n (another menu table) or a table consisting of two items: string menu text\n and a function or action table just like in `keys`. The table can\n optionally contain 2 more number values: a GDK keycode and modifier mask\n for setting a menu accelerator. If the menu text is `'separator'`, a menu\n separator is created and no action table is required.\n@see keys.get_gdk_key\n@see rebuild_command_tables
+set_menubar _M.textadept.menu.set_menubar(menubar)\nSets `gui.menubar` from the given table of menus.\n@param menubar The table of menus to create the menubar from.\n@see gui.menu\n@see rebuild_command_tables
set_save_point buffer.set_save_point(buffer)\nRemember the current position in the undo history as the position at which\nthe document was saved.\n@param buffer The global buffer.
set_sel buffer.set_sel(buffer, start_pos, end_pos)\nSelect a range of text.\nThe caret is scrolled into view after this operation.\n@param buffer The global buffer.\n@param start_pos Start position. If negative, it means the end of the\n document.\n@param end_pos End position. If negative, it means remove any selection (i.e.\n set the `anchor` to the same position as `current_pos`).
set_sel_back buffer.set_sel_back(buffer, use_setting, color)\nSet the background color of the main and additional selections and whether to\nuse this setting.\n@param buffer The global buffer.\n@param use_setting Enable color change.\n@param color A color in `0xBBGGRR` format.
@@ -1473,6 +1474,7 @@ setuservalue debug.setuservalue(udata, value)\nSets the given `value` as the Lua
setvbuf file:setvbuf(mode [, size])\nSets the buffering mode for an output file. There are three available\nmodes:\n "no": no buffering; the result of any output operation appears immediately.\n "full": full buffering; output operation is performed only when the\n buffer is full or when you explicitly `flush` the file (see\n `io.flush`).\n "line": line buffering; output is buffered until a newline is output or\n there is any input from some special files (such as a terminal\n device).\n\nFor the last two cases, `size` specifies the size of the buffer, in\nbytes. The default is an appropriate size.
shebangs _M.textadept.mime_types.shebangs (table)\nShebang words and their associated lexers.
show_apidoc _M.textadept.adeptsense.show_apidoc(sense)\nShows a calltip with API documentation for the symbol behind the caret.\n@param sense The Adeptsense returned by `adeptsense.new()`.\n@return `true` on success or `false`.\n@see get_symbol\n@see get_apidoc
+show_completions gui.command_entry.show_completions(completions)\nShows the given list of completions for the current word prefix.\nOn selection, the current word prefix is replaced with the completion.\n@param completions The table of completions to show. Non-string values are\n ignored.
show_documentation _M.textadept.adeptsense.show_documentation()\nShows API documentation for the symbol at the current position based on the\ncurrent lexer's Adeptsense.\nThis should be called by key commands and menus instead of `show_apidoc()`.
show_lines buffer.show_lines(buffer, start_line, end_line)\nMake a range of lines visible.\nThis has no effect on fold levels or fold flags. `start_line` can not be\nhidden.\n@param buffer The global buffer.\n@param start_line The start line.\n@param end_line The end line.
sin math.sin(x)\nReturns the sine of `x` (assumed to be in radians).
@@ -1492,7 +1494,7 @@ start_styling buffer.start_styling(buffer, position, mask)\nSet the current styl
starts_line lexer.starts_line(patt)\nCreates an LPeg pattern from a given pattern that matches the beginning of a\nline and returns it.\n@param patt The LPeg pattern to match at the beginning of a line.\n@usage local preproc = token(l.PREPROCESSOR, #P('#') * l.starts_line('#' *\n l.nonnewline^0))
status buffer.status (number)\nThe error status.\n\n* `_SCINTILLA.constants.SC_STATUS_OK` (0)\n No failures.\n* `_SCINTILLA.constants.SC_STATUS_FAILURE` (1)\n Generic failure.\n* `_SCINTILLA.constants.SC_STATUS_BADALLOC` (2)\n Memory is exhausted.
status coroutine.status(co)\nReturns the status of coroutine `co`, as a string: `"running"`, if\nthe coroutine is running (that is, it called `status`); `"suspended"`, if\nthe coroutine is suspended in a call to `yield`, or if it has not started\nrunning yet; `"normal"` if the coroutine is active but not running (that\nis, it has resumed another coroutine); and `"dead"` if the coroutine has\nfinished its body function, or if it has stopped with an error.
-statusbar_text gui.statusbar_text (string)\nThe text displayed by the statusbar.
+statusbar_text gui.statusbar_text (string, Write-only)\nThe text displayed by the statusbar.
stderr io.stderr (file)\nStandard error.
stdin io.stdin (file)\nStandard in.
stdout io.stdout (file)\nStandard out.
@@ -1567,7 +1569,7 @@ text_width buffer.text_width(buffer, style_num, text)\nMeasure the pixel width o
textadept _M.textadept (module)\nThe textadept module.\nIt provides utilities for editing text in Textadept.
time os.time([table])\nReturns the current time when called without arguments, or a time\nrepresenting the date and time specified by the given table. This table\nmust have fields `year`, `month`, and `day`, and may have fields `hour`\n(default is 12), `min` (default is 0), `sec` (default is 0), and `isdst`\n(default is nil). For a description of these fields, see the `os.date`\nfunction.\n\nThe returned value is a number, whose meaning depends on your system. In\nPOSIX, Windows, and some other systems, this number counts the number of\nseconds since some given start time (the "epoch"). In other systems, the\nmeaning is not specified, and the number returned by `time` can be used only\nas an argument to `os.date` and `os.difftime`.
timeout _G.timeout(interval, f, ...)\nCalls a given function after an interval of time.\nTo repeatedly call the function, return true inside the function. A `nil` or\n`false` return value stops repetition.\n@param interval The interval in seconds to call the function after.\n@param f The function to call.\n@param ... Additional arguments to pass to `f`.
-title gui.title (string)\nThe title of the Textadept window.
+title gui.title (string, Write-only)\nThe title of the Textadept window.
tmpfile io.tmpfile()\nReturns a handle for a temporary file. This file is opened in update\nmode and it is automatically removed when the program ends.
tmpname os.tmpname()\nReturns a string with a file name that can be used for a temporary\nfile. The file must be explicitly opened before its use and explicitly\nremoved when no longer needed.\n\nOn POSIX systems, this function also creates a file with that name, to avoid\nsecurity risks. (Someone else might create the file with wrong permissions in\nthe time between getting the name and creating the file.) You still have to\nopen the file to use it and to remove it (even if you do not use it).\n\nWhen possible, you may prefer to use `io.tmpfile`, which automatically\nremoves the file when the program ends.
toggle _M.textadept.bookmarks.toggle()\nToggles a bookmark on the current line.
diff --git a/modules/lua/tags b/modules/lua/tags
index f41e9848..a65d6821 100644
--- a/modules/lua/tags
+++ b/modules/lua/tags
@@ -100,6 +100,7 @@ MARK_HIGHLIGHT_BACK _ 0;" F class:_M.textadept.editing
MAX _ 0;" F class:_M.textadept.snapopen
MAX_RECENT_FILES _ 0;" F class:_M.textadept.session
MENU_CLICKED _ 0;" F class:events
+NCURSES _ 0;" F
NUMBER _ 0;" F class:lexer
OPERATOR _ 0;" F class:lexer
OSX _ 0;" F
@@ -1100,7 +1101,6 @@ grab_focus _ 0;" f class:buffer
graph _ 0;" F class:lexer
grow_selection _ 0;" f class:_M.textadept.editing
gsub _ 0;" f class:string
-gtkmenu _ 0;" f class:gui
gui _ 0;" m
gui _ 0;" t
gui.command_entry _ 0;" m
@@ -1273,6 +1273,7 @@ math _ 0;" m
math _ 0;" t
max _ 0;" f class:math
max_line_state _ 0;" F class:buffer
+menu _ 0;" f class:gui
menu _ 0;" t class:_M.textadept
menubar _ 0;" t class:_M.textadept.menu
menubar _ 0;" t class:gui
@@ -1514,6 +1515,7 @@ setuservalue _ 0;" f class:debug
setvbuf _ 0;" f class:file
shebangs _ 0;" t class:_M.textadept.mime_types
show_apidoc _ 0;" f class:_M.textadept.adeptsense
+show_completions _ 0;" f class:gui.command_entry
show_documentation _ 0;" f class:_M.textadept.adeptsense
show_lines _ 0;" f class:buffer
sin _ 0;" f class:math