void () { EditorSettingsExternalizable settings = EditorSettingsExternalizable.getInstance(); settings.setStripTrailingSpaces(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_NONE); configureFromFileText("x.txt", ""); type("xxx \nyyy \nzzz \n"); getEditor().getCaretModel().moveToOffset(0); end();end(); FileDocumentManager.getInstance().saveAllDocuments(); checkResultByText("xxx <caret>\nyyy \nzzz \n"); settings.setStripTrailingSpaces(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_CHANGED); type(' '); getEditor().getCaretModel().moveToOffset(getEditor().getDocument().getText().length()); FileDocumentManager.getInstance().saveAllDocuments(); checkResultByText("xxx\nyyy \nzzz \n<caret>"); }