Sublime Forum

Percent symbol highlighted in C

#1

Hi,

how can I disable percent(%) symbol highlighting in C syntax highliting? And by the way, what is it for?

0 Likes

#2

The percent (%) operator in C and C++ is the modulus operator. It returns the first number mod the second number. Source
But why it’s highlights in strings, Idk, probably it’s a bug.

0 Likes

#3

It’s highlighting the % because it’s assuming that you’re making a printf format string, and that you’ve made it wrong. Unfortunately there’s no way to tell it it’s not a printf format string short of changing the syntax file.

0 Likes

#4

@ArtDesire, I was asking what is the percent symbol highlighting for, not what does percent symbol do :smile:.

Anyway, thanks. I’ve commented the value “invalid.illegal.placeholder.c” in C.tmLanguage on line 1116 and it’s gone :unamused:.

0 Likes