Sublime Forum

Turning specific texts into italic

#1

Hello. I am new here and i’ve posted 2 or 3 days ago a question, and happily, i got my solution to it. Thank you once again!
Now i want to know something easy… but for me is not that easy peasy…
I want to turn the strlen() function into italic… what should i change and where should i look first?

(i dont know if it formats well)
if(strlen(inputtext) == 0)
to this
if(strlen(inputtext) == 0)

Thank you in advance!

0 Likes

#2

If you want to italic all function calls, it can be quite easy since it may be mostly just a color scheme thing.

If you only want strlen to be italic. It’s actually not easy. To do that accurately, you have to understand ST’s C/C++ syntax definition. And after your modifications, you are now responsible for maintaining it, which is a bad thing for a complex syntax like C/C++. In this case, a 3rd-party plugin may be preferred to highlight specific texts (but I have no experience, so no suggested one).

1 Like

#3

Yes, sir. I want the first option. The color scheme thing. That is all what i want. Functions to be written in italic.

0 Likes

#4

You can add the following rule to your color scheme

        {
            "font_style": "italic",
            "name": "Function/Method calls",
            "scope": "support.function, variable.function",
        },

As for how to modify color scheme… hmm… I believe OdatNurd had answered several times but I don’t know how to find one. (Yeah. I am lazy to write my own one-time tutorial.)

As for how the interested scope is found, simply press ctrl+alt+shift+p on strlen.

1 Like

#5

Thank you so much. Now i will figure it out, i am a grown man! Sorry for taking your time!

0 Likes

#6

Find one from OdatNurd’s reply history.

1 Like

#7

Yes, thank you. I did it faster than i ever thought. Hehe! Have a good night! (9:30 pm here)

1 Like