[TxMt] Re: Escaping in snippets
Christoph Wockel
christoph.wockel at gmx.net
Wed Sep 24 08:41:52 UTC 2008
sure, I want to insert
$00
where the second 0 should be inserted as text. The wouraround would be
$0``0. Unfortunately, I was not able to create an easy where the text
flashes on insertion, this only occurs when I use the following Perl
script, which I use to move the caret forward on hitting return inside
LaTeX inline equations (see the screenshot for the whole bundle editor
entry).
#!/usr/bin/env perl
$_=<STDIN>;
$_=~/^(.{$ENV{'TM_LINE_INDEX'}}(?:\\?[a-zA-Z]+|.)?)(.*)$/;
$tmp1=$1;
$tmp2=$2;
$tmp1=~s/(\\|\$|`)/\\$1/g;
$tmp2=~s/(\\|\$|`)/\\$1/g;
if($tmp2=~/^[0-9]/){$tmp2 = "``".$tmp2}
print $tmp1."\$"."0".$tmp2;
On 24.09.2008, at 10:12, Hans-Jörg Bibiko wrote:
>
> On 24.09.2008, at 09:56, Christoph Wockel wrote:
>
>> Hello everyone,
>>
>> if I insert a snippet with a tabstop, which is immediately followed
>> by
>> a number (without any white spaces in between), the number gets
>> interpreted as belonging to the tabstop. Is there a way to aviod
>> this?
>>
>> I want to put the caret to an arbitrary location of a (script
>> generated) replaced text, which might be inside a number block. The
>> solution I have is to put a pair of backticks before the number, but
>> then the inserted text flashes on insertion, so it does not seem to
>> be
>> the correct way to solve this.
>
> Could you please post an example?
>
> --Hans
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20080924/d1c1f0d9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Picture 2.png
Type: image/png
Size: 42332 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20080924/d1c1f0d9/attachment.png>
More information about the textmate
mailing list