|
1 | | -*luasnip.txt* For NVIM v0.5.0 Last change: 2022 October 05 |
| 1 | +*luasnip.txt* For NVIM v0.5.0 Last change: 2022 October 06 |
2 | 2 |
|
3 | 3 | ============================================================================== |
4 | 4 | Table of Contents *luasnip-table-of-contents* |
@@ -1057,12 +1057,19 @@ is only a short outline, their usage is shown more expansively in |
1057 | 1057 | Contains everything from `conditions.show` as well. |
1058 | 1058 | - `conditions`: Provides a function `make_condition(foo)` which takes a function |
1059 | 1059 | as argument and returns a _condition object_ for which several operators are |
1060 | | - defined: `c1 + c2 -> c1 or c2`, `c1 * c2 -> c1 and c2`, `-c1 -> not c1`, |
1061 | | - `c1 ^ c2 -> c1 xor/!= c2`, `c1 % c2 -> c1 xnor/== c2`. Thus you can easily |
1062 | | - combine existing predicats. Like in |
1063 | | - `conditions.expand.line_end + conditions.expand.line_begin` instead of doing |
1064 | | - something like |
1065 | | - `function(...) return conditions.expand.line_end(...) or conditions.expand.line_begin(...) end`. |
| 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). For more details look at |
| 1068 | + this comment <https://github.com/L3MON4D3/LuaSnip/pull/612#issuecomment-1264487743> |
| 1069 | + Thus you can easily combine existing predicats. Like in |
| 1070 | + `conditions.expand.line_end + conditions.expand.line_begin` instead of doing |
| 1071 | + something like |
| 1072 | + `function(...) return conditions.expand.line_end(...) or conditions.expand.line_begin(...) end`. |
1066 | 1073 |
|
1067 | 1074 |
|
1068 | 1075 | FMT *luasnip-fmt* |
|
0 commit comments