local get_visual = function(args, parent) if #parent.snippet.env.SELECT_RAW > 0 then return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) else return sn(nil, i(1, "")) end end local translation_table = { ["("] = ")", ["{"] = "}", ["["] = "]" } -- Return snippet tables return { -- LEFT/RIGHT ALL BRACES s( { trig = "([^%a])l([%(%[%{])", regTrig = true, wordTrig = false, snippetType = "autosnippet", }, fmta("<>\\left<><>\\right<>", { f(function(_, snip) return snip.captures[1] end), f(function(_, snip) return snip.captures[2] end), d(1, get_visual), f(function(_, snip) return translation_table[snip.captures[2]] end), }) ), }