Skip to content

rep node seems to reset the countΒ #550

@danielo515

Description

@danielo515

Hello, first of all, thanks for the most impressive snippet engine I ever used, period.
I may be wrong, but I think I noticed an undocumented (and for me unexpected) behavior.
It seems that the rep node is skipt in the node count. So, to give you an example, this snippet is correct:

  s({ trig = "test", dscr = "just a test" }, fmt("{} {} {}", { i(1, "x"), rep(1), i(2, "y") })),

Note that, despite being three nodes, and 3 items in the list the last insert node must refer to the 2 position. While it can make sense if you know it, this is a bit confusing and I think it should at least be documented.

It becomes even weirder when you put it in first place, because you say it should repeat the first node, then the next is the first node, and it seems to produce very strange behaviours too:

  s( "test", fmt("{} {} {}", { rep(1), i(1, "x"), i(2, "y") })),

For example, for some reason it exits my insert mode, so the next thing I type is often interpreted as a vim command, however this is not always the case, and not all keys behaves like this, very strange...

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