aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/._M.luadoc49
-rw-r--r--core/keys.lua28
2 files changed, 31 insertions, 46 deletions
diff --git a/core/._M.luadoc b/core/._M.luadoc
index fada7185..89c0cb57 100644
--- a/core/._M.luadoc
+++ b/core/._M.luadoc
@@ -4,13 +4,13 @@
--[[ This comment is for LuaDoc.
---
--- A table of loaded modules.
+-- A table of loaded Lua modules used by Textadept.
--
-- ## Module Guidelines
--
--- At the very least, modules consist of a single directory with an *init.lua*
--- script. However, the script may load additional Lua files present in the
--- directory. (For an example, see *modules/textadept/init.lua*.)
+-- Textadept modules are identical to Lua modules and behave in the same way.
+-- Modules consist of a single directory with an *init.lua* script and any
+-- necessary support files. (For an example, see *modules/textadept/init.lua*.)
--
-- Loaded modules, even language modules, persist in Textadept's Lua State;
-- Textadept never unloads them. Therefore, modules should define functions or
@@ -19,22 +19,9 @@
-- ### Language Modules
--
-- To fully take advantage of Textadept's features, language modules should have
--- at a minimum: a block comment string, run and/or compile commands, an event
--- handler for setting buffer properties like indentation, and if possible, an
--- Adeptsense. Optional features are extra snippets and commands and a context
--- menu.
---
--- #### Block Comment
---
--- The `Ctrl+/` (`⌘/` on Mac OSX | `M-/` in curses) key binding toggles code
--- comments. In order for this to work for your language, the
--- [`_M.textadept.editing.comment_string`][] table must have a key with the
--- language's lexer name assigned to a comment prefix string. For Lua, it would
--- look like
---
--- _M.textadept.editing.comment_string.lua = '--'
---
--- [`_M.textadept.editing.comment_string`]: _M.textadept.editing.html#comment_string
+-- at a minimum: run and/or compile commands, an event handler for setting
+-- buffer properties like indentation, and if possible, an Adeptsense. Optional
+-- features are extra snippets and commands and a context menu.
--
-- #### Compile and Run
--
@@ -127,17 +114,17 @@
-- For Lua this might look like
--
-- M.context_menu = {
--- { _L['_Undo'], buffer.undo },
--- { _L['_Redo'], buffer.redo },
--- { '' },
--- { _L['Cu_t'], buffer.cut },
--- { _L['_Copy'], buffer.copy },
--- { _L['_Paste'], buffer.paste },
--- { _L['_Delete'], buffer.clear },
--- { '' },
--- { _L['Select _All'], buffer.select_all },
--- { '' },
--- { 'Autocomplete "end"', M.try_to_autocomplete_end }
+-- {_L['_Undo'], buffer.undo},
+-- {_L['_Redo'], buffer.redo},
+-- {''},
+-- {_L['Cu_t'], buffer.cut},
+-- {_L['_Copy'], buffer.copy},
+-- {_L['_Paste'], buffer.paste},
+-- {_L['_Delete'], buffer.clear},
+-- {''},
+-- {_L['Select _All'], buffer.select_all},
+-- {''},
+-- {'Autocomplete "end"', M.try_to_autocomplete_end}
-- }
--
-- [context menus]: _M.textadept.menu.html#set_contextmenu
diff --git a/core/keys.lua b/core/keys.lua
index 50ad2948..1f7a023a 100644
--- a/core/keys.lua
+++ b/core/keys.lua
@@ -26,18 +26,18 @@ local M = {}
--
-- ## Key Sequences
--
--- Key sequences are strings built from a combination of modifier keys and the
--- key itself. Modifier keys are "Control", "Shift", and "Alt" on Windows,
--- Linux, BSD, and in curses. On Mac OSX they are "Command" (`⌘`), "Alt/Option"
--- (`⌥`), "Control" (`^`), and "Shift" (`⇧`). These modifiers have the following
--- string representations:
+-- Key sequences are strings built from an ordered combination of modifier keys
+-- and the key itself. Modifier keys are "Control", "Shift", and "Alt" on
+-- Windows, Linux, BSD, and in curses. On Mac OSX they are "Control" (`^`),
+-- "Alt/Option" (`⌥`), "Command" (`⌘`), and "Shift" (`⇧`). These modifiers have
+-- the following string representations:
--
--- Modifier | Linux / Win32 | Mac OSX | Terminal |
+-- Modifier | Linux / Win32 | Mac OSX | curses |
-- ---------|---------------|---------|----------|
--- Control | `'c'` | `'m'` | `'c'` |
+-- Control | `'c'` | `'c'` | `'c'` |
-- Alt | `'a'` | `'a'` | `'m'` |
+-- Command | N/A | `'m'` | N/A |
-- Shift | `'s'` | `'s'` | `'s'` |
--- Command | N/A | `'c'` | N/A |
--
-- The string representation of key values less than 255 is the character that
-- Textadept would normally insert if the "Control", "Alt", and "Command"
@@ -55,25 +55,23 @@ local M = {}
-- ## Commands
--
-- A command bound to a key sequence is either a Lua function or a table
--- containing a Lua function with a set of arguments to pass. Examples are:
+-- containing a Lua function with a set of arguments to pass. They are
+-- functionally equivalent; you can use either. Examples are:
--
-- keys['cn'] = buffer.new
-- keys['cs'] = buffer.save
-- keys['a('] = {_M.textadept.editing.enclose, '(', ')'}
-- keys['cu'] = function() io.snapopen(_USERHOME) end
--
--- (The function and function table syntax are functionally equivalent. You can
--- use either.)
---
-- Textadept handles [`buffer`][] references properly in static contexts.
--
-- [`buffer`]: buffer.html
--
-- ## Modes
--
--- You can group together sets of key bindings into modes. When a key
--- [mode](#MODE) is active, Textadept ignores all key bindings defined outside
--- the mode until the mode is unset. Here is a simple vi mode example:
+-- Modes are groups of key bindings such that when a key [mode](#MODE) is
+-- active, Textadept ignores all key bindings defined outside the mode until the
+-- mode is unset. Here is a simple vi mode example:
--
-- keys.command_mode = {
-- ['h'] = buffer.char_left,