From fed4dcf93a94d0ddf9887981f808eb78b2b87ec1 Mon Sep 17 00:00:00 2001 From: Lazar Bulovan Date: Sat, 21 Feb 2026 01:39:17 +0100 Subject: [PATCH] docs: add auto-editing features section to AGENTS.md --- AGENTS.md | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index b184e27..ec7713b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -283,6 +283,34 @@ The LSP supports goto declaration functionality for: Usage: Place cursor on a variable or type name and press `gD` (or use LSP client command). +## Auto-Editing Features + +### Auto-Uppercase Keywords +When typing SCL keywords followed by a space, they are automatically converted to uppercase: +- `if ` → `IF ` +- `then ` → `THEN ` +- `end_if` → `END_IF` +- etc. + +Works in `.scl`, `.udt`, and `.db` files. + +### Auto-Semicolon for Control Structures +When pressing Enter after an `END_*` control structure keyword, a semicolon is automatically added: +- `END_IF` → `END_IF;` +- `END_FOR` → `END_FOR;` +- `END_WHILE` → `END_WHILE;` +- `END_REPEAT` → `END_REPEAT;` +- `END_CASE` → `END_CASE;` + +Block definitions (END_VAR, END_FUNCTION, etc.) are NOT affected. + +### Auto-Prefix Local Variables +Local variables are automatically prefixed with `#` when typing space or semicolon after BEGIN: +- `myVar := ` → `#myVar := ` +- `counter.in` → `#counter.in` (on dot) + +Can be toggled with `:lua require("scl.auto_prefix").toggle()`. + ## Keybindings (SCL/UDT files) ### Attribute Block Toggle @@ -304,9 +332,6 @@ Interactive expand/collapse of individual `{...}` blocks (uses `x` prefi | Key | Mode | Description | |-----|------|-------------| -| `xa` | Normal/Insert | Toggle attribute block under cursor | -| `xae` | Normal | Expand all attribute blocks | -| `xac` | Normal | Collapse all attribute blocks | | `mp` | Insert | Fill multiline FB parameters | | `` | Insert | Jump to next parameter or regular Tab |