void () { CommonCodeStyleSettings javaCommonSettings = mySettings.getCommonSettings(JavaLanguage.INSTANCE); int oldRightMargin = javaCommonSettings.RIGHT_MARGIN; boolean oldShouldWrap = mySettings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN; javaCommonSettings.RIGHT_MARGIN = 80; mySettings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = true; try { configureByFile("/codeInsight/editing/beforeAutoWrapRightMargin.java"); for (int i = 0; i != 47; ++i) { type(' '); } checkResultByFile("/codeInsight/editing/afterAutoWrapRightMargin.java"); } finally { javaCommonSettings.RIGHT_MARGIN = oldRightMargin; mySettings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = oldShouldWrap; } }