void () { Editor editor = getFirstEditor(); EditorTestUtil.setEditorVisibleSize(editor, 10, 3); typeInText("a\nb\nc\nd\n"); executeEditorAction(editor, IdeActions.ACTION_SELECT_ALL); executeEditorAction(editor, IdeActions.ACTION_EDITOR_COPY); executeEditorAction(editor, IdeActions.ACTION_EDITOR_TEXT_START); executeEditorAction(editor, IdeActions.ACTION_EDITOR_PASTE); undoFirstEditor(); VisualPosition caretPosition = editor.getCaretModel().getVisualPosition(); Point caretXY = editor.visualPositionToXY(caretPosition); assertTrue(editor.getScrollingModel().getVisibleAreaOnScrollingFinished().contains(caretXY)); }