IDEA-90890 Some code formatting preferences ignored sometimes

This commit is contained in:
Denis.Zhdanov
2012-09-01 22:25:45 +04:00
parent 976fe5321d
commit 7464fddc64
@@ -99,7 +99,8 @@ public class BraceEnforcer extends JavaJspRecursiveElementVisitor {
private void processStatement(PsiStatement statement, PsiStatement blockCandidate, int options) {
if (blockCandidate instanceof PsiBlockStatement || blockCandidate == null) return;
boolean forceNewLine = !FormatterUtil.isFormatterCalledExplicitly() && !ApplicationManager.getApplication().isUnitTestMode();
boolean forceNewLine = !FormatterUtil.isFormatterCalledExplicitly() && !ApplicationManager.getApplication().isUnitTestMode()
&& !myPostProcessor.getSettings().KEEP_CONTROL_STATEMENT_IN_ONE_LINE;
if (forceNewLine
|| options == CommonCodeStyleSettings.FORCE_BRACES_ALWAYS
|| (options == CommonCodeStyleSettings.FORCE_BRACES_IF_MULTILINE && PostFormatProcessorHelper.isMultiline(statement)))