Hi,
is there any difference to insert something as snippet by using a normal tmSnippet and tmCommand which is set to the output 'Insert as Snippet' and input 'selected text or line'?
My problem:
I have a document containing the line:
build_cpu=`echo $ac_cv_build | sed 's/^([^-]*)-([^-]*)-(.*)$/ 1/'` ;
At the end of that line I'd like to insert a snippet '${1:Hallo} World'. If I do it via a tmSnippet it works perfectly. But if I write a tmCommand à la:
Command: in=$(cat) caret=$TM_COLUMN_NUMBER-1 lnhead=${in:0:$caret} lnend=${in:$caret} echo -en "$lnhead${1:Hallo}World$lnend"
Output: Insert as Snippet Input: sel. text or line
it crashes, meaning TM inserts: 'build_cpu= ; HalloWorld'.
Maybe TM has some problems while parsing the line? But as tmSnippet it works? If you change the output to 'Show as Tooltip' the command did the job correctly. I only can guess that if in the line occurs a '$' TM will have problems. And if this is true, what can I do? I already tried to escape all '$' in the variable 'in' but no success.
Any hint would be very helpful. The example as tmCommand I attached to this mail.
Thanks,
Hans