void () { initText("abc\n<caret>"); int lineHeight = getEditor().getLineHeight(); int heightInPixels = (int)(lineHeight * 1.5); EditorTestUtil.setEditorVisibleSizeInPixels(getEditor(), 1000 * EditorUtil.getSpaceWidth(Font.PLAIN, getEditor()), heightInPixels); getEditor().getSettings().setAnimatedScrolling(false); type('a'); assertEquals(lineHeight - (heightInPixels - lineHeight) / 2, getEditor().getScrollingModel().getVerticalScrollOffset()); type('b'); assertEquals(lineHeight - (heightInPixels - lineHeight) / 2, getEditor().getScrollingModel().getVerticalScrollOffset()); }