Skip to content
Discussion options

You must be logged in to vote

Oh, interesting!

You can do

s("dc", fmt([[
    DECLARE {i1}{dashes18} CURSOR FOR
        {i0}
    FREE {i1}
]], {
    i1 = i(1, "", {key = "first", node_callbacks = {
        [events.leave] = function(node)
            vim.schedule(function()
                node.parent.snippet:get_keyed_node("dashes"):set_text({""})
            end)
        end
    }}),
    dashes18 = f(function(args)
        return ("-"):rep(18 - #args[1][1])
    end, k("first"), {key = "dashes"}),
    i0 = i(0)
}, {repeat_duplicates = true}))

ie. manually clear the functionNode after jumping out of the i(1).

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@L3MON4D3
Comment options

Answer selected by pmurray17
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants