void () { configureFromText("abc\n\n\n\n\nabc\n"); EditorTestUtil.setEditorVisibleSize(getEditor(), 100, 3); executeAction(IdeActions.ACTION_EDITOR_TEXT_END_WITH_SELECTION); EditorTestUtil.testUndoInEditor(getEditor(), () -> { initFind(); myFindModel.setReplaceState(true); myFindModel.setGlobal(false); myFindModel.setStringToFind("abc"); myFindModel.setStringToReplace("def"); try { myLivePreviewController.performReplace(); myLivePreviewController.performReplace(); } catch (FindManager.MalformedReplacementStringException e) { fail(e.getMessage()); } executeAction(IdeActions.ACTION_UNDO); executeAction(IdeActions.ACTION_UNDO); checkResultByText("abc\n\n\n\n\nabc\n"); checkOffsetIsVisible(getEditor(), 0); }); }