Replies: 1 comment
-
Mhmm, that s({
trig= "%S/",
regTrig=true,
wordTrig=false,
snippetType="autosnippet"
}, fmta([[
\frac{<>}{<>}<>
]], {
f(function(args, snip, line_to_cursor)
local snip_range_from, _ = snip.snippet:get_buf_position()
local snip_line = snip_range_from[1]
local snip_from_col = snip_range_from[2]
local before_snip_str = vim.api.nvim_buf_get_text(0, snip_line, 0, snip_line, snip_from_col, {})
return auto_fraction(before_snip_str)
end, {}),
i(1),
i(2)
}), {
condition = function()
return true
-- return math()
end
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm making a latex snippet for fractions and I need to use an external
auto_fraction(str)
function that operates over a string up to the cursor position:How do I actually use
line_to_cursor
in thef()
node?Beta Was this translation helpful? Give feedback.
All reactions