hsnips
hsnips copied to clipboard
Tabstop with default content not in `t` array
This works fine:
snippet box "Box" A
``rv = '┌' + '─'.repeat(t[0].length + 2) + '┐'``
│ $1 │
``rv = '└' + '─'.repeat(t[0].length + 2) + '┘'``
endsnippet
But when $1
is replaced by ${1:text}
, snippet Box fails to expand with error: Cannot read property 'length' of undefined. I checked the value of t.length
and got 0
.
I noticed that tabstops introduced by js code interpolation are also not in t
array (even without default content). The following snippet throws the same error:
snippet box "Box" A
``rv = '┌' + '─'.repeat(t[0].length + 2) + '┐'``
│ ``rv = `${snip.tabstop(1)}` `` │
``rv = '└' + '─'.repeat(t[0].length + 2) + '┘'``
endsnippet
Is there any way to solve this?
I agree this would be so usefull!