Skip to content

Commit 0d1582a

Browse files
committed
Merge branch 'feature/FindAll' of https://github.com/daddel80/notepadpp-multireplace into feature/FindAll
2 parents 6e792be + 25dbfc2 commit 0d1582a

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ Formats numbers based on precision (maxDecimals) and whether the number of decim
350350

351351
#### **lcmd(path)**
352352

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.
354354

355355
**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(...)`).
356356
**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
403403
| `(\d+)` | `set(padLeft(CAP1, 6, '0'))` | Use helper loaded by `lcmd` to zero-pad (`123``000123`). |
404404
| `(.+)` | `set(slug(CAP1))` | Use helper loaded by `lcmd` to create a slug (`Hello World!``hello-world`). |
405405

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).
410-
411406
<br>
412407

413408
### Operators
414-
| Type | Operators |
415-
|-------------|-------------------------------|
416-
| Arithmetic | `+`, `-`, `*`, `/`, `^`, `%` |
417-
| Relational | `==`, `~=`, `<`, `>`, `<=`, `>=`|
418-
| Logical | `and`, `or`, `not` |
409+
| Type | Operators | Example |
410+
|----------------|------------------------------------------|--------------------------------------------------------|
411+
| Concatenation | `..` | `set("Found "..CNT)` |
412+
| Arithmetic | `+`, `-`, `*`, `/`, `^`, `%` | `set(CNT * 2)` |
413+
| Relational | `==`, `~=`, `<`, `>`, `<=`, `>=` | `cond(LINE == 1, "First", "Not first")` |
414+
| Logical | `and`, `or`, `not` | `cond(LINE > 5 and CNT < 10, "Midrange", "Other")` |
419415

420416
<br>
421417

0 commit comments

Comments
 (0)