You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-11Lines changed: 7 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -350,7 +350,7 @@ Formats numbers based on precision (maxDecimals) and whether the number of decim
350
350
351
351
#### **lcmd(path)**
352
352
353
-
Load user-defined helper functions from a Lua file. The file **must**`return` a table of functions. `lcmd` registers those functions as globals for the current run.
353
+
Load user-defined helper functions from a Lua file. The file must `return` a table of functions. `lcmd` registers those functions as globals for the current run.
354
354
355
355
**Purpose:** add reusable helper functions (formatters, slugifiers, padding, small logic). Helpers **must return a string or number** and are intended to be called from **action** commands (e.g. `set(...)`, `cond(...)`).
356
356
**Init usage:** can be used as an init entry (empty Find) to preload before replacements; not mandatory. See [Preload variables & helpers](#preload-variables--helpers) for workflow and examples.
@@ -403,19 +403,15 @@ Use init entries (empty Find) to preload variables or helper functions before an
403
403
|`(\d+)`|`set(padLeft(CAP1, 6, '0'))`| Use helper loaded by `lcmd` to zero-pad (`123` → `000123`). |
404
404
|`(.+)`|`set(slug(CAP1))`| Use helper loaded by `lcmd` to create a slug (`Hello World!` → `hello-world`). |
405
405
406
-
#### File notes
407
-
-`lvars` / `lcmd` files must **return a table**. Recommended extension: `*.lua` (e.g. `myVars.vars`, `mycmds.lcmd`).
408
-
-`lcmd` registers helper functions globally for the run and **errors on name collisions** (no overrides).
409
-
- Errors from loading are reported to the user (loader returns `(false, errMsg)` on failure).
0 commit comments