Sublime Forum

C++ namespace and public not highlighted?

#1

I’m sure this has been asked a million time, and I’ve looked around for some help, but couldn’t find any.

Anyway, my problem is the keywords “namespace”, and “public” in C++ don’t get highlighted, they just stay the default color:

using namespace std; /* Namespace not colored */

namespace test /* Namespace not colored */
{
  // code
}

public class foo; /* Public not highlighted */

Can someone please help me? If you need any more info, ask me and I can try to answer.

0 Likes

#2

Have you tried different color themes?

If that solves it, then the problem is in the theme you are using. You could try to add some scope to it… although I don’t know what scope would target those keywords.

This is a declaration on a color theme, you would need to add something like that to the theme you are using, but with the right scope.

       <dict>
            <key>name</key>
            <string>Library class/type</string>
            <key>scope</key>
            <string>support.class</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string>italic</string>
                <key>foreground</key>
                <string>#66D9EF</string>
            </dict>
        </dict>
0 Likes