[TxMt] Re: smart home

Robin Houston robin.houston at gmail.com
Tue Apr 10 10:36:29 UTC 2007


On 4/10/07, Constantinos Neophytou ♎ <jaguarcy at gmail.com> wrote:
>
>
> Excellent... one issue though, it seems that it trims some of the
> line with it on certain cases. I use smarty templates in some of my
> work, and some lines have text like:
>
>         {$var|modifier}
>
> after using the command, $var disappears (everything before the pipe,
> not including the left curly brace)


When Simon translated Steve's Perl code into Ruby, he missed out a crucial
line:

  # Escape anything in the line that might be mistaken
  # as a snippet token.
  $line =~ s/([\$\\`])/\\\1/g;

In Ruby, I think that would be:

  line.gsub!(/([\$\\`])/){"\\#$1"};

Robin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20070410/f53949e7/attachment.html>


More information about the textmate mailing list