Closed flotisable closed 1 year ago
Thanks for reporting! Glad you find this plugin useful :)
Thanks for your quick response.
The fix resolve the issue in the example. However, it seems the fix breaks a lot of snippet conversion. The example below works as expected before
snippet if "if control flow"
if ${1:<condition>}
"
${2:${VISUAL}}
"
endif
snippet ife "if else control flow"
if ${1:<condition>}
"
${2}
"
else
"
${3}
"
endif
snippet func "function definition"
function ${1:<function name>}(${2:<arguments>})
"
${3:${VISUAL}}
"
endfunction
after the fix, it is only converted to the snippet below, note the if
and func
snippet disappear
{
"ife": {
"prefix": "ife",
"description": "\"if else control flow\"",
"body": [
"if ${1:<condition>}",
"\"",
"\t$2",
"\"",
"else",
"\"",
"\t$3",
"\"",
"endif",
""
]
}
}
If you would like to see more detail, my snippets can be found at https://github.com/flotisable/FlotisableVimSnippets.
Clone the repo, and update the snippet-converter.nvim submodule, then run make convert
.
The converted difference between previous version and the fix can then be seen with git diff
First of all, thanks for the great scripts to convert the snippet to variant format.
I'm trying to convert my snippets from snipmate format to vim-vsnip format. When there is
\
in the snippet, which is used to escape$
in the snippet, it disappears in vim-vsnip format. This causes the snippet to be unexpected when being expanded.Below is an example, note the
\$option
is conveted to$option
snipmate snippetThis snippet is converted to vim-vsnip snippet
The expected snippet after conversion is below, note the
\\
before$option