@@ -17,7 +17,8 @@ local dl = require("luasnip.extras").dynamic_lambda
1717local fmt = require (" luasnip.extras.fmt" ).fmt
1818local fmta = require (" luasnip.extras.fmt" ).fmta
1919local types = require (" luasnip.util.types" )
20- local conds = require (" luasnip.extras.expand_conditions" )
20+ local conds = require (" luasnip.extras.conditions" )
21+ local conds_expand = require (" luasnip.extras.conditions.expand" )
2122
2223-- If you're reading this file for the first time, best skip to around line 190
2324-- where the actual snippet-definitions start.
@@ -320,16 +321,27 @@ ls.add_snippets("all", {
320321 return line_to_cursor :match (" %s*//" )
321322 end ,
322323 }),
323- -- there's some built-in conditions in "luasnip.extras.expand_conditions ".
324+ -- there's some built-in conditions in "luasnip.extras.conditions.expand" and "luasnip.extras.conditions.show ".
324325 s (" cond2" , {
325326 t (" will only expand at the beginning of the line" ),
326327 }, {
327- condition = conds .line_begin ,
328+ condition = conds_expand .line_begin ,
328329 }),
329330 s (" cond3" , {
330331 t (" will only expand at the end of the line" ),
331332 }, {
332- condition = conds .line_end ,
333+ condition = conds_expand .line_end ,
334+ }),
335+ -- on conditions some logic operators are defined
336+ s (" cond4" , {
337+ t (" will only expand at the end and the start of the line" ),
338+ }, {
339+ -- last function is just an example how to make own function objects and apply operators on them
340+ condition = conds_expand .line_end
341+ + conds_expand .line_begin
342+ * conds .make_condition (function ()
343+ return true
344+ end ),
333345 }),
334346 -- The last entry of args passed to the user-function is the surrounding snippet.
335347 s (
0 commit comments