void () { CommonCodeStyleSettings.IndentOptions indentOptions = CodeStyle.getSettings(getProject()).getCommonSettings(JavaLanguage.INSTANCE).getIndentOptions(); assertNotNull(indentOptions); indentOptions.KEEP_INDENTS_ON_EMPTY_LINES = true; final String initial = """ public class Main { public void foo(boolean a, int x, int y, int z) { do { if (x > 0) { <caret> } } while (y > 0); } }"""; doTest( initial, """ public class Main { public void foo(boolean a, int x, int y, int z) { do { if (x > 0) { <caret> } } while (y > 0); } }""" ); }