Bug with snippets (multiple mirrored replaced)

Roman Komarov fa 8 anys 0

Here is a simple test-case you can try in ST’s console:

view.run_command("insert_snippet", {"contents" : "snippet: ${1/.+/1/}$1${1/.+/2/} ${1/.+/1/}$1${1/.+/2/} ${1/.+/1/}$1${1/.+/2/}"})

When you have a snippet with more than one mirrored replacements going before the mirrored tabstops, the order of the inserted snippets is broken.

So, in example above you can see that all three space-separated parts are equal, however if you’d run this snippet and write something like `foo`, then you’d get

snippet: 1foo2 foo12 foo12

and that’s wrong, it should be:

snippet: 1foo2 1foo2 1foo2

That bug is really a stopper for what I want to do :(