[TxMt] Re: Python bundle syntax highlighting bug

Steve Lianoglou lists at arachnedesign.net
Tue Aug 14 12:39:14 UTC 2007


Hi,

>> I agree that it's very nice to have highlighted re's if possible.
>>
>> What if we did something like matching r"(?#) … " as a regular
>> expression string?    The would give us something explicit to match,
>> but it would also mean you'd have to add it to any of your  
>> preexisting
>> re's.
>
> That sounds like a very good idea.  It would be pretty easy to find  
> regexes and sub in a '(?#)' comment marker (I had to look up what  
> that one was!) so one would have regex syntax highlighting in  
> existing code, while keeping the 'raw strings are just raw strings'  
> folks happy.  For those who complain that r'(?# might just be the  
> beginning of some particular, non-regex raw string, well.... too  
> bad!  ;)

To be honest, I don't really like this idea too much (in lieu of  
having to use re.*(r" ... ") in order to get the regex highlight,  
let's say).

While adding a (?#) is "harmless" in terms of the parsing of the  
actual code, changing your code to fit your text editor just doesn't  
"feel" right. More tangibly, I think it's probably "the wrong thing  
to do" if you're working on a project w/ other people (especially if  
they're not fellow TextMate users). The code won't break, but I could  
imagine that the extra line noise could tick people off and add some  
bit-rot to your version control ...

-steve


More information about the textmate mailing list