+8

Python Raw String with Escape character bad color coding

Sylvain Berger fa 13 anys updated by Jindřich Vavruška fa 11 anys 1
When declaring a raw string in python using this method:
a - r'This\is\a\stupid\windows\path\with\backslashes'

All the backslash and the following letters gets a different color coding.

It would be great if the raw string would totally ignore the escaping characters and gets color coded as a string

+1

It is not color coding, it is wrong interpretation in editor.


When you type this:


    myDir = os.path.join( r'C:\RootOfAllEvil\', 'myfile.txt' )


then editor interprets the string as "C:\RootOfAllEvil', " and the rest of the line is broken (and \R is highlighted as invalid escape).


Obviously, Sublime Text has never heard of raw strings in python. For me it is unusable, as I do quite a lot of python programming.