void () { if (myScrollToTheEndOnAppend) { myEditor.getCaretModel().moveToOffset(myEditor.getDocument().getTextLength()); myEditor.getSelectionModel().removeSelection(); myEditor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE); } }