[SVN] Revision 1126 (Python)

Allan Odgaard allan at macromates.com
Tue May 31 01:25:54 UTC 2005


On May 30, 2005, at 22:57, Jeroen van der Ham wrote:

> - Added lookahead assertion to the string matching so that only  
> single-line strings or lines that end with '\' can begin a string.
> There's currently no way to enforce that other lines also have to  
> end in \

Personally I prefer to have the rest of the document colored as a  
string, when I don't have the proper closing.

As for strings not ending with backslash. You could make something like:

{  name = "string.quoted.double.py";
    begin = "\""; end = "\"|(?<!\\\\)(?:\\\\\\\\)*(\\n)";
    swallow = "\\\\.";
    endCaptures = {
       1 = { name = "invalid.illegal.open-string.py"; };
    };
},

If you set the background of invalid.* to e.g. red, it'll be very  
clear where the string breaks (since styling a \n covers the area to  
the right of the line).

(credits to Kevin for his input on this and actually doing the end  
regex)




More information about the textmate-dev mailing list