void () { boolean oldWrapValue = mySettings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN; int oldMarginValue = mySettings.getDefaultRightMargin(); mySettings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = true; mySettings.setDefaultRightMargin(10); try { init("qqqq aaaa<caret>", PlainTextFileType.INSTANCE); type('b'); checkResultByText("qqqq aaaab"); type('c'); checkResultByText("qqqq \naaaabc"); } finally { mySettings.WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN = oldWrapValue; mySettings.setDefaultRightMargin(oldMarginValue); } }