Skip to content

Commit

Permalink
Maybe also document condition-function.
Browse files Browse the repository at this point in the history
  • Loading branch information
L3MON4D3 committed Aug 3, 2021
1 parent 370c3c3 commit 2a422d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions DOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ The second argument to `s` is a table containing all nodes that belong to the
snippet. If the table only has a single node, it can be passed directly
without wrapping it in a table.

The third argument is the condition-function. The snippet will be expanded only
if it returns true (default is a function that just returns true).

The fourth and following args are passed to the condition-function(allows
reusing condition-functions).

Snippets contain some interesting tables, eg. `snippet.env` contains variables
used in the LSP-protocol like `TM_CURRENT_LINE` or `TM_FILENAME` or
`snippet.captures`, where capture-groups of regex-triggers are stored. These
Expand Down

0 comments on commit 2a422d5

Please sign in to comment.