No new empty line inserted
For some reason I can't make it insert an empty line.
"[G] New item": {
"prefix": "itm",
"body": [
"",
"\\item $0"
]
}
aaa itm| -> aaa \item |
Is there a work around
Oh huh, that's weird, hadn't encountered that one before..
As a band-aid, you can use ls.parser.parse_snippet and the lua-loader to add that snippet, it'll be a tiny bit before I can look into this properly.
Thank you for your fast response. For reference, the following works as intended:
s({
name = "[G] New item",
trig = "itm",
wordTrig = false,
}, {
t({"", [[\item ]]}),
}),
Hey, finally got around to fixing this :)
Turns out, this was just because the parser removes leading/trailing newlines by default (useful for defining snippets in [[...]] while keeping indentation, bad when parsing snippets from vscode where a newline is very deliberate)