Sublime Forum

Weird python Syntax highlighting OSX

#1

Hello,

I am getting weird syntax highlighting when adding notes with \ in multi line comments. I have only noticed this bug on OSX linux.

Does anyone know why this is happening and how I can remove it?

Thanks
Adam.

0 Likes

#2

The “comment” is a multiline string. The purple bit is an escape sequence in that string. The Python syntax does generally highlight escape sequences in strings.

0 Likes

#3

thank you, do you know how I can change this setting for inside multi line comments?

0 Likes

#4

It sounds like you want to add a rule to your color scheme coloring comment.block.documentation.python constant.character.escape the same color as comment:

{
    "rules": [
        {
            "name": "Python doc comment escape characters",
            "scope": "comment.block.documentation.python constant.character.escape",
            "foreground": "whatever color comments are"
        },
    ]
}

Save this in your User package as SchemeName.sublime-color-scheme, where SchemeName is the name of the color scheme you use.

0 Likes