Auto indent doesn't work properly


#1

When using auto indent, the editor doesn’t properly de-indent after closing braces, so this code:

void test() {
    if (asdf) {
        
    }
    else {
        
    }
}

gets turned into this:

void test() {
    if (asdf) {
        
        }
        else {
            
            }
        }

If you start with unindented code, it works fine. It only breaks if you try to auto-indent code that is already somewhat indented.


#2

Are you selecting the text before you execute the Auto Indent function? If so, see this Issue:

You may want to try just running Auto Indent without selecting anything.


Autoindent not working properly in python?