Sublime Forum

Annoying auto-indentation behavior

#1

I DO want this behavior (pressing enter will keep me on the same indentation level):
keep_line

However, I do NOT want whatever this is trying to do (it changes existing indentation when I type certain things on it):
wtf

Is there any way to get this? Ideally I don’t want any kind of “smart” or automatic indentation behavior at all, except for what’s in the the first example. My current indentation related settings are these:
“auto_indent”: true,
“smart_indent”: false,
“indent_to_bracket”: false,
“trim_automatic_white_space”: false,
“shift_tab_unindent”: true,

0 Likes

#2

The "smart_indent" setting control that behavior. I have noticed that in the latest builds this setting doesn’t apply immediately. I’ll be looking into fixing that. In the mean time you can either reopen the file or restart ST to apply those settings.

0 Likes

#3

Apologies, upon further investigation there doesn’t seem to be a bug here. This is a feature of auto_indent; there’s currently no way to disable this through settings while keeping other features of auto_indent.

A bit of an involved fix could be to edit the indentation rules for C/C++ (Located in C++/Indentation Rules.tmPreferences) to remove case and default from the regexes. I suggest using the OverrideAudit package if you plan on going this route.

1 Like