This is probably related to this. You can use Shift+Alt/Option+F to format the code as needed rather than only on save.