Autoformat problem

I have a code with fscommand in an if statement.


if(condition){
     fscommand();
}

Upon autoformat the fscommand just gets pushed outside the if statement for no reason.


if(condition){
}
fscommand();

Any reason this occurs?

Also if there is a statement after the fscommand nothing happens on autoformat


if(condition){
     fscommand();
     nil = nil;
}