void () { final CodeStyleSettings settings = CodeStyle.getSettings(myFixture.getProject()); final CommonCodeStyleSettings commonCodeStyleSettings = settings.getCommonSettings(MarkdownLanguage.INSTANCE); int oldValue = commonCodeStyleSettings.RIGHT_MARGIN; boolean oldMarginValue = settings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN; commonCodeStyleSettings.RIGHT_MARGIN = 100; settings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = true; try { final String testName = getTestName(true); myFixture.configureByFile(testName + ".md"); for (int i = 0; i != 45; ++i) { myFixture.type(' '); } myFixture.checkResultByFile(testName + ".after.md"); } finally { commonCodeStyleSettings.RIGHT_MARGIN = oldValue; settings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = oldMarginValue; } }