Allan recently isolated a bug I found to be in the regular expression library TextMate uses and we're waiting for a response. While we wait I was looking to implement the feature that crashed TextMate and I hoped you all could help me out with some ruby or perl (or whatever) voodoo.
The bug is explained here: http://ollieman.net/videos/find-bug.mov
The expected behavior is explained here: http://ollieman.net/videos/desired.mp4
It works the rest of the time, it's just when at the beginning of the document that it crashes.
Thanks in advance for any help.
--oliver
P.S. Are these videos a good way to ask questions? I feel like it's difficult to articulate without actually showing you.
On May 4, 2006, at 3:00 PM, Oliver Taylor wrote:
I was looking to implement the feature that crashed TextMate and I hoped you all could help me out with some ruby or perl (or whatever) voodoo.
I'm happy to help, if I can get my head around the problem. Does this sound right?
1. When triggered the macro looks backwards from the cursor position for lines beginning with four tabs? 2. The first such line is skipped and the second such line inserted where the cursor is.
What is supposed to happen if there is only one such line in the document. (I know it crashes, but what is it suppose to do?)
James Edward Gray II
On 4/5/2006, at 22:00, Oliver Taylor wrote:
Allan recently isolated a bug I found to be in the regular expression library TextMate uses and we're waiting for a response [...]
I uploaded a new build with the fix: http://macromates.com/textmate/ build/TextMate_r989.tbz
Or the (smaller) PPC-only version: http://macromates.com/textmate/ build/ppc/TextMate_r989.tbz
Be aware that Finder will likely not allow overwriting the existing version of TextMate, because of the Edit in TM symbolic link, which marks it as “in use”. It’s only an advisory lock, so open Terminal and just rm -rf the old TextMate.app from there.
On May 4, 2006, at 3:00 PM, Oliver Taylor wrote:
Allan recently isolated a bug I found to be in the regular expression library TextMate uses and we're waiting for a response. While we wait I was looking to implement the feature that crashed TextMate and I hoped you all could help me out with some ruby or perl (or whatever) voodoo.
The bug is explained here: http://ollieman.net/videos/find-bug.mov
The expected behavior is explained here: http://ollieman.net/videos/ desired.mp4
It works the rest of the time, it's just when at the beginning of the document that it crashes.
Thanks in advance for any help.
If I understand the problem correct, the script below does that. Input set to 'Entire Document', Output to 'Insert as Text'.
Gerd
#!/usr/bin/perl -w $m1=$m2=''; $c=1; while(<>) { if(/^\t{4}(.+)[\r\n]+$/) { $m1=$m2; $m2=$1; } $c++; last if($c==$ENV{'TM_LINE_NUMBER'}); } print "\n\n\t\t\t\t$m1";