Closed RazerM closed 8 years ago
Good point. I'm in the middle of a bunch of changes, so I'll throw this in there too. Thanks!
As I recall, raw strings are often used for regex, so the regex highlighter kicks in and that is why escapes are highlighted. As far as I can tell, there is no way to distinguish a raw string that is not meant for regex from a raw string meant for regex. I personally prefer having the escaped chars to no regex highlighting.
Another good point. I'll look at exactly how the regexes work - there might be a way to exclude #escaped_chars
and still include the escapes defined in source.regex.python
. I'm at work now, so I can't look ATM...
By coincidence I found out that this is "fixed" already (as it is in the original Python syntax):
Basically, upper case R
won't apply regex highlighting.
As it turns out, while adding an uppercase R
will remove regex highlighting, the R
is now scoped as a constant instead of storage.type.string.python
. I'll see if I can fix this.
I'll be releasing 2.1 soon. With it, you can now (again) use R"..."
to designate raw strings with no regex highlighting, while r"..."
should retain the old behavior.
Raw strings have the same formatting as normal strings, so backslashes are incorrectly interpreted as escapes, for example:
It would be useful if raw strings didn't highlight escapes differently.