Is it possible to change color of "{0}".format()?

Answered

I love that when you use an escape character like /n it turns it orange. This makes it easy to find.

 

When I create a string, I usually use "{0}".format(), but I notice that {0} doesn't turn orange. 

Is there a way to make it so? I've looked through the settings and I can't figure it out. 

10 comments
Comment actions Permalink

Are you looking to change the color of the {0} part or the whole string?  Because I have all my strings set to one color while the special characters like \n are slightly different.

 

My configuration, I set it in the default and then inherit, but you can also set it directly in the language.

0
Comment actions Permalink

I have the same settings as you, I just wish to change the {0} in a string to a different color. I just think that this helps me point out or better read my code when that pops out because it's technically a special number within braces.

I just thought it would be great to have that feature. I'm sure I'm not the only one who'd like this as well :).

2
Comment actions Permalink

I am agree, i need the same too. very helpful

1
Comment actions Permalink

Hi, I believe PY-29046 covers the request, please feel free to vote for it.

1
Comment actions Permalink

Hi Виталий,

 

Seems like you are using some custom plugin(s). Try disabling them and see if problem remains.

1
Comment actions Permalink

HI Sergey,

I did what you adviced, but nothing changed. (Offcourse, I restarted pycharm)


 

0
Comment actions Permalink

Hi, which PyCharm version is this? Could you please check a more recent one?

1
Comment actions Permalink

Thanks Pavel, you was right it's helped.



 And now I have next one:

0
Comment actions Permalink

Try starting with defaults by renaming configuration folder (https://intellij-support.jetbrains.com/hc/en-us/articles/206544519). Has it helped?

0

Please sign in to leave a comment.