Sublime Forum

Syntax highlighting borks on a certain Python regex

#1

Sublime Text 2’s Python syntax highlighting borks on the following code:

[code]reo = re.compile(r’(?msu)(^|.)((?P^]]+?)])?’
+ r’(?:’ + re.escape(lq) + r’)’
+ r’(?P.+?)(?:’+re.escape(rq)+r’)’)

print “this is some code with wrong syntax highlighting”
print “the problems continue until the end of the document”[/code]
You can see that it thinks the regexp never ends and highlights the rest of the document as part of the regexp.

This code is a snippet from asciidoc.py. The problem screws up the highlighting in 70% of the file.

Please fix the syntax highlighting. I’m on Sublime Text 2 build 2165 on OS X Snow Leopard. TextMate has the same problem, so I’m guessing you’re just reusing the TextMate syntax file.

0 Likes

#2

I’m still experiencing this problem on version 2.0.1, build 2217.

0 Likes