aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/events.lua45
-rw-r--r--modules/textadept/keys.lua5
-rw-r--r--modules/textadept/lsnippets.lua5
3 files changed, 30 insertions, 25 deletions
diff --git a/core/events.lua b/core/events.lua
index 9c8cbdb4..e4140c9e 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -5,8 +5,9 @@
-- Most of Textadept's functionality comes through handlers. Scintilla
-- notifications, Textadept's own events, and user-defined events can all be
-- handled.
---
--- @usage
+module('textadept.events', package.seeall)
+
+-- Usage:
-- Each event can have multiple handlers, which are simply Lua functions that
-- are called in the sequence they are added as handler functions. Sometimes it
-- is useful to have a handler run under a specific condition(s). If this is the
@@ -16,47 +17,49 @@
-- defined. A handler can simply be added for an event name, and 'handle'd when
-- necessary.
--
+-- For reference, events will be shown in 'event(arguments)' format, but in
+-- reality, the event is handled as 'handle(event, arguments)'.
+--
-- Scintilla notifications:
--- char_added
+-- char_added(ch)
-- ch: the (integer) character added.
--- save_point_reached
--- save_point_left
--- double_click
+-- save_point_reached()
+-- save_point_left()
+-- double_click(position, line)
-- position: the position of the beginning of the line clicked.
-- line: the line clicked.
--- update_ui
--- macro_record
+-- update_ui()
+-- macro_record(message, wParam, lParam)
-- message: the SCI_* message.
-- wParam: wParam in SCI_*.
-- lParam: lParam in SCI_*.
--- margin_click
+-- margin_click(margin, modifiers, position)
-- margin: the margin number.
-- modifiers: mouse modifiers.
-- position: the position of the beginning of the line at the point clicked.
--- user_list_selection
+-- user_list_selection(wParam, text)
-- wParam: the user list ID.
-- text: the text of the selected item.
--- uri_dropped:
+-- uri_dropped(text)
-- text: the URI dropped.
--- call_tip_click
+-- call_tip_click(position)
-- position: 1 or 2 if the up or down arrow was clicked; 0 otherwise.
--- auto_c_selection
+-- auto_c_selection(lParam, text)
-- lParam: the start position of the word being completed.
-- text: the text of the selected item.
--
-- Textadept events:
--- buffer_new
--- buffer_deleted
--- buffer_switch
--- view_new
--- view_switch
--- quit
--- keypress
+-- buffer_new()
+-- buffer_deleted()
+-- buffer_switch()
+-- view_new()
+-- view_switch()
+-- quit()
+-- keypress(code, shift, control, alt)
-- code: the key code.
-- shift: flag indicating whether or not shift is pressed.
-- control: flag indicating whether or not control is pressed.
-- alt: flag indicating whether or not alt is pressed.
-module('textadept.events', package.seeall)
local events = textadept.events
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua
index 996cdabf..89fd4b36 100644
--- a/modules/textadept/keys.lua
+++ b/modules/textadept/keys.lua
@@ -13,7 +13,9 @@
-- ADD: The string representing used to join together a sequence of Control,
-- Shift, or Alt modifier keys.
--
--- @usage
+module('_m.textadept.keys', package.seeall)
+
+-- Usage:
-- Keys are defined in the global table 'keys'. Keys in that table are key
-- sequences, and values are tables of Lua functions and arguments to execute.
-- The exceptions are language names, style names, and keychains (discussed
@@ -64,7 +66,6 @@
-- Keep in mind that all Lua functions used in key commands must be defined
-- BEFORE the key command references it. Therefore the module containing key
-- commands should be loaded LAST, after all other modules have been loaded.
-module('_m.textadept.keys', package.seeall)
-- options
local SCOPES_ENABLED = true
diff --git a/modules/textadept/lsnippets.lua b/modules/textadept/lsnippets.lua
index f7773639..0e1ad0a7 100644
--- a/modules/textadept/lsnippets.lua
+++ b/modules/textadept/lsnippets.lua
@@ -12,7 +12,9 @@
-- MARK_SNIPPET_COLOR: The Scintilla color used for the line
-- that marks the end of the snippet.
--
--- @usage
+module('_m.textadept.lsnippets', package.seeall)
+
+-- Usage:
-- Snippets are defined in the global table 'snippets'. Keys in that table are
-- snippet trigger words, and values are the snippet's text to insert. The
-- exceptions are language names and style names. Language names have table
@@ -66,7 +68,6 @@
-- * Only '`' needs to be escaped in shell code.
-- * '|'s after the first in transformations do not need to be escaped.
-- * Only unmatched ')'s need to be escaped. Nested ()s are ignored.
-module('_m.textadept.lsnippets', package.seeall)
local MARK_SNIPPET = 4
local MARK_SNIPPET_COLOR = 0x4D9999