Sublime Forum

Inline errors shown for "escaped" characters in C define

#1

Hellau,

I opened up some old configuration file containing C code defining configuration paths. The C syntax shows inline errors (pink background) for using backslash + character in a string.

The compiler suite in use in this project does not escape inside strings so this is not necessary. Is it possible to deactivate the highlighting of escape strings?

0 Likes

#2

Maybe I am totally mislead, but escapes like \n and \r are handled as newlines in C. Not sure what \f is used for, but a single \ in a C-string is interpreted as escape. If you want to define a constant path, you’d need to use \\ as path separator.

Highlighting those things can not simply be disabled. It’s hard-coded in the syntax definition.

0 Likes

#3

Hi @deathaxe,

you are perfectly correct. In my context though the escape mechanic is disabled for C files.

I’ll try to create a new syntax based on the existing C syntax but without the escape highlighting.

0 Likes