Skip to content

Repeat node in choice node breaks the choice node tabstop? 🤔 #1443

Description

@bew

Hello @L3MON4D3 😃

It's been a while! Hope you're doing well 😉

I'm trying to make a snippet that expands to "var:", vim.inspect(var) but can also do "var:", var on-demand with a choice node.

    ls.add_snippets("all", {
      ls.snippet({ trig="bad" }, fmta(
        [["<var>:", <value><more>]],
        {
          var = i(1, "var", {key="the-var"}),
          value = ls.choice_node(2, {
            fmta(
              [[vim.inspect(<var_again>)]],
              { var_again = rep(k"the-var") }
            ),
            rep(k"the-var"),
          }),
          more = i(3),
        }
      )),
    })
Screencast_20260614_202720.mp4

For some reason it seems to skip the choice node at <value> and jump straight for the <more> after it.
Changing the fmta in the choice node to simple text nodes work but I want to have the var name repeated..

I'm honestly not sure why it breaks, it doesn't look too complex compared to other snippets I have 👀

Tested on 2.5.0 (but I've found it on latest commit 0abc8f3, merged into my types branch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions