draivin / hsnips

HyperSnips: a powerful snippet engine for VS Code, inspired by vim's UltiSnips
MIT License
154 stars 25 forks source link

Replace all instances of id when replacing tabstops in rv #118

Closed Alan-Liang closed 2 years ago

Alan-Liang commented 2 years ago

Sometimes we may want to reuse the return value of snip.tabstop(), such as in m[0].replace(/@/g, snip.tabstop(1)). This would cause hsnips to replace only the first instance with a correct tabstop, and leave the second instance as [gibberish]. This commit fixes it.