The access modifier are part of the normal indent/unindent chain like braces. Means ST auto-indents the next function declaration afterwards and therefore unindents the next access modifier keyword to ensure them to be one level less indented, then the declarations.
If you want to indent the access modifiers by 1 you’d need to indent the function declaration in front of it by 2 levels.
class Card {
void _read();
public:
Card();
~Card();
}
You can modify the indention rules to exclude the access modifiers, but this results in
class Card {
void _read();
public:
Card();
~Card();
}
To do so, you’d need to create a Pakages/C++/Indention Rules.tmPreferences as override for the default indention rules of the builtin C++ package with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>name</key>
<string>Indentation Rules</string>
<key>scope</key>
<string>source.c, source.c++, source.objc, source.objc++</string>
<key>settings</key>
<dict>
<key>decreaseIndentPattern</key>
<string>(?x)
^ (.*\*/)? \s* \} .* $
# | ^ \s* (public|private|protected): \s* $
| ^ \s* @(public|private|protected) \s* $
</string>
<key>increaseIndentPattern</key>
<string>(?x)
^ .* \{ [^}"']* $
# | ^ \s* (public|private|protected): \s* $
| ^ \s* @(public|private|protected) \s* $
</string>
<key>bracketIndentNextLinePattern</key>
<string>(?x)
^ \s* \b(if|while|else)\b [^;]* $
| ^ \s* \b(for)\b .* $
</string>
<key>unIndentedLinePattern</key>
<string><![CDATA[^\s*((/\*|.*\*/|//|#|template\b.*?>(?!\(.*\))|@protocol|@interface(?!.*\{)|@implementation|@end).*)?$]]></string>
<key>indentSquareBrackets</key>
<true/>
</dict>
</dict>
</plist>
Note: The code block shows a copy of the builtin C++ indention rules with (public|private|protected)
commented out.