Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728local ls = require("luasnip")local f = ls.function_nodelocal postfix = require("luasnip.extras.postfix").postfix
local mod = { postfix = {},}
mod.postfix.increment = postfix({ trig = "++", hidden = true,}, { f(function(_, parent) return string.format("%s = %s + 1", parent.snippet.env.POSTFIX_MATCH, parent.snippet.env.POSTFIX_MATCH) end, {}),})
mod.postfix.decrement = postfix({ trig = "--", hidden = true,}, { f(function(_, parent) return string.format("%s = %s - 1", parent.snippet.env.POSTFIX_MATCH, parent.snippet.env.POSTFIX_MATCH) end, {}),})
return mod