[TxMt] Re: smart home
Simon Strandgaard
neoneye at gmail.com
Tue Apr 10 13:32:38 UTC 2007
On 4/10/07, Robin Houston <robin.houston at gmail.com> wrote:
> 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"};
>
Yes indeed. Thanks
problem: when text is selected and invoking this smart-home-command,
then the selected text is erased.
Any ideas how to avoid this?
--
Simon Strandgaard
http://opcoders.com/
More information about the textmate
mailing list