_M.lua - Textadept API

# Textadept

- Home |
- Download |
- Lua API |
- Source |
- Language Modules |
- Stats |
- Wiki |
- Mailing List

# _M.lua

The lua module. It provides utilities for editing Lua code.

## Key Bindings

- `Ctrl+L, M` (`⌘L, M` on Mac OSX | `M-L, M` in curses) Open this module for editing.
- `.` Show an autocompletion list of fields for the symbol behind the caret.
- `:` Show an autocompletion list of functions for the symbol behind the caret.
- `Shift+Enter` (`⇧↩` | `S-Enter`) Autocomplete an `if`, `while`, `for`, etc. control structure with the `end` keyword.

## Fields

### `sense`

The Lua Adeptsense. It loads user tags from `_USERHOME`/modules/lua/tags and user apidocs from `_USERHOME`/modules/lua/api.

## Functions

### `try_to_autocomplete_end`()

Tries to autocomplete control structures like `if`, `while`, `for`, etc. with the `end` keyword.

See also:

- `control_structure_patterns`

## Tables

### `_G.keys.lua`

Container for Lua-specific key bindings.

### `_G.snippets.lua`

Container for Lua-specific snippets.

### `control_structure_patterns`

List of patterns for auto-`end` completion for control structures.

See also:

- `try_to_autocomplete_end`