void () { // Inspired by IDEA-69872 String initial = """ class Test { <caret> void test() { } }"""; init(initial, JavaFileType.INSTANCE); final CommonCodeStyleSettings.IndentOptions options = mySettings.getIndentOptions(JavaFileType.INSTANCE); options.USE_TAB_CHARACTER = true; options.TAB_SIZE = 4; final EditorSettings editorSettings = getEditor().getSettings(); final boolean old = editorSettings.isCaretInsideTabs(); editorSettings.setCaretInsideTabs(false); try { ApplicationManager.getApplication() .runWriteAction(() -> CodeStyleManager.getInstance(getProject()).reformatText(getFile(), 0, getEditor() .getDocument().getTextLength())); } finally { editorSettings.setCaretInsideTabs(old); } String expected = """ class Test { \t<caret>void test() { \t} }"""; checkResultByText(expected); }