Skip to content

Commit 014ce2c

Browse files
Auto generate docs
1 parent 9b473f2 commit 014ce2c

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

doc/luasnip.txt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*luasnip.txt* For NVIM v0.5.0 Last change: 2022 September 28
1+
*luasnip.txt* For NVIM v0.5.0 Last change: 2022 October 08
22

33
==============================================================================
44
Table of Contents *luasnip-table-of-contents*
@@ -1049,6 +1049,31 @@ is only a short outline, their usage is shown more expansively in
10491049
<
10501050

10511051

1052+
1053+
- `conditions.show`: Contains typical predicats/functions used as
1054+
`show`-condition. Currently this is just `line_end`
1055+
- `conditions.expand`: Contains typical predicats/functions used as
1056+
`expand`-condition. Currently this is just `line_begin` Contains everything
1057+
from `conditions.show` as well.
1058+
- `conditions`: Provides a function `make_condition(foo)` which takes a function
1059+
as argument and returns a _condition object_ for which several operators are
1060+
defined:
1061+
- `c1 + c2 -> c1 or c2`
1062+
- `c1 * c2 -> c1 and c2`
1063+
- `-c1 -> not c1`
1064+
- `c1 ^ c2 -> c1 xor/!= c2`
1065+
- `c1 % c2 -> c1 xnor/== c2`: This decision may look weird but as we weren’t
1066+
able to use `==`, we decided to take something that makes one scratch ones
1067+
head (and thus avoid making false assumptions).
1068+
For more details look at this comment <https://github.com/L3MON4D3/LuaSnip/pull/612#issuecomment-1264487743>.
1069+
`conditions.show`s and `conditions.expand`s members all are also condition
1070+
objects so you can work with those too.
1071+
Thus you can easily combine existing predicats. Like in
1072+
`conditions.expand.line_end + conditions.expand.line_begin` instead of doing
1073+
something like `function(...) return conditions.expand.line_end(...) or
1074+
conditions.expand.line_begin(...) end`.
1075+
1076+
10521077
FMT *luasnip-fmt*
10531078

10541079
`require("luasnip.extras.fmt").fmt` can be used to create snippets in a more

0 commit comments

Comments
 (0)