Hi there,
I had this hideous bug in on of my rjs templates. The bug was in this line:
page[:login].visual_effect :blind_down
now, most of you (who know rjs) will think that's a perfectly good line. However, there is a bug in it. That line gets converted to this javascript:
$("login").visualEffect ("blind_down");
It turns out that the character between the .visual_effect and the :blind_down is *not* a standard space. It's some sort of carriage return/line feed which is displayed as a space in TextMate (and Mail it seems too).
Now, not wanting to spark up any editor wars or anything, but BBEdit displays the lines like this:
page[:login].visual_effect :blind_down
$("login").visualEffect ("blind_down");
so it's now obvious where the bug is... and why my div wasn't blinding down ;-)
Is there any way I can get TextMate to alert me to the fact that this character *isn't* a space? And therefore stop this hair-pulling bug from happening again :-)
SAm
Interestingly, in Mail, the editor window presented this crazy character as a space, but the window that lets you read sent items showed it as a carriage return.
Confusing :-)
On 20 Nov 2006, at 12.43 pm, Sam Aaron wrote:
Hi there,
I had this hideous bug in on of my rjs templates. The bug was in this line:
page[:login].visual_effect :blind_down
now, most of you (who know rjs) will think that's a perfectly good line. However, there is a bug in it. That line gets converted to this javascript:
$("login").visualEffect ("blind_down");
It turns out that the character between the .visual_effect and the :blind_down is *not* a standard space. It's some sort of carriage return/line feed which is displayed as a space in TextMate (and Mail it seems too).
Now, not wanting to spark up any editor wars or anything, but BBEdit displays the lines like this:
page[:login].visual_effect :blind_down
$("login").visualEffect ("blind_down");
so it's now obvious where the bug is... and why my div wasn't blinding down ;-)
Is there any way I can get TextMate to alert me to the fact that this character *isn't* a space? And therefore stop this hair- pulling bug from happening again :-)
SAm
For those interested, here's the file containing the nasty bug (which is now in a commented line).
Looking at the file in a hex editor shows that the 'space' as the combination of the following three values: E2 80 A9, whereas a standard space is: 20
On 20 Nov 2006, at 14:13, Sam Aaron wrote:
For those interested, here's the file containing the nasty bug (which is now in a commented line).
Looking at the file in a hex editor shows that the 'space' as the combination of the following three values: E2 80 A9, whereas a standard space is: 20
E2 80 A9 is the unicode 'Paragraph Separator' see more
http://comox.textdrive.com/pipermail/textmate/2006-October/013900.html
Cheers,
Hans
I had this hideous bug in on of my rjs templates. The bug was in this line:
page[:login].visual_effect :blind_down
now, most of you (who know rjs) will think that's a perfectly good line. However, there is a bug in it. That line gets converted to this javascript:
The real solution would be to highlight that as an invalid.illegal space in the grammar file when it's in that position (Only allow spaces) But might be pretty hard to do depending on how the grammar is laid out and the syntax and such. (Which I don't know for JS)